home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / pascal / wndw70.zip / WNDWREF.DOC < prev    next >
Text File  |  1993-06-10  |  125KB  |  2,542 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                            MULTI-LEVEL VIRTUAL WINDOWS
  20.                                  REFERENCE GUIDE
  21.  
  22.                                   Version 7.0a
  23.                                   June 10, 1993
  24.  
  25.  
  26.                Copyright (C) 1993 Eagle Performance Software
  27.                               All Rights Reserved.
  28.  
  29.  
  30.  
  31.                                _______                     
  32.                           ____|__     |               (tm) 
  33.                        --|       |    |------------------- 
  34.                          |   ____|__  |  Association of    
  35.                          |  |       |_|  Shareware         
  36.                          |__|   o   |    Professionals     
  37.                        -----|   |   |--------------------- 
  38.                             |___|___|    MEMBER            
  39.  
  40.  
  41.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  42.  
  43.  
  44.  
  45.                        T A B L E   O F   C O N T E N T S
  46.  
  47.         1. INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . 5
  48.              Purpose . . . . . . . . . . . . . . . . . . . . . . . 5
  49.              Common Parameters . . . . . . . . . . . . . . . . . . 5
  50.              Attributes  . . . . . . . . . . . . . . . . . . . . . 6
  51.  
  52.         2. PROCEDURES AND FUNCTIONS  . . . . . . . . . . . . . . . 7
  53.              AccessWindow  . . . . . . . . . . . . . . . . . . . . 7
  54.              ChangeBorder  . . . . . . . . . . . . . . . . . . . . 7
  55.              FillB . . . . . . . . . . . . . . . . . . . . . . . . 7
  56.              FillC . . . . . . . . . . . . . . . . . . . . . . . . 8
  57.              FillW . . . . . . . . . . . . . . . . . . . . . . . . 8
  58.              FindB . . . . . . . . . . . . . . . . . . . . . . . . 8
  59.              FindRevB  . . . . . . . . . . . . . . . . . . . . . . 8
  60.              FindRevW  . . . . . . . . . . . . . . . . . . . . . . 8
  61.              FindW . . . . . . . . . . . . . . . . . . . . . . . . 9
  62.              GetLevelIndex . . . . . . . . . . . . . . . . . . . . 9
  63.              HeapOK  . . . . . . . . . . . . . . . . . . . . . . . 9
  64.              HideWindow  . . . . . . . . . . . . . . . . . . . . . 9
  65.              InitWindow  . . . . . . . . . . . . . . . . . . . . . 9
  66.              InRangeB  . . . . . . . . . . . . . . . . . . . . . . 10
  67.              InRangeI  . . . . . . . . . . . . . . . . . . . . . . 10
  68.              InRangeL  . . . . . . . . . . . . . . . . . . . . . . 10
  69.              InRangeW  . . . . . . . . . . . . . . . . . . . . . . 10
  70.              LimitB  . . . . . . . . . . . . . . . . . . . . . . . 11
  71.              LimitI  . . . . . . . . . . . . . . . . . . . . . . . 11
  72.              LimitL  . . . . . . . . . . . . . . . . . . . . . . . 11
  73.              LimitW  . . . . . . . . . . . . . . . . . . . . . . . 11
  74.              LocateCursor  . . . . . . . . . . . . . . . . . . . . 11
  75.              MakeWindow  . . . . . . . . . . . . . . . . . . . . . 12
  76.              MaxB  . . . . . . . . . . . . . . . . . . . . . . . . 12
  77.              MaxI  . . . . . . . . . . . . . . . . . . . . . . . . 12
  78.              MaxL  . . . . . . . . . . . . . . . . . . . . . . . . 12
  79.              MaxW  . . . . . . . . . . . . . . . . . . . . . . . . 12
  80.              MinB  . . . . . . . . . . . . . . . . . . . . . . . . 13
  81.              MinI  . . . . . . . . . . . . . . . . . . . . . . . . 13
  82.              MinL  . . . . . . . . . . . . . . . . . . . . . . . . 13
  83.              MinW  . . . . . . . . . . . . . . . . . . . . . . . . 13
  84.              MoveWindow  . . . . . . . . . . . . . . . . . . . . . 13
  85.              MoveB . . . . . . . . . . . . . . . . . . . . . . . . 14
  86.              MoveW . . . . . . . . . . . . . . . . . . . . . . . . 14
  87.              RemoveWindow  . . . . . . . . . . . . . . . . . . . . 14
  88.              RestoreBorder . . . . . . . . . . . . . . . . . . . . 14
  89.              RestoreTurboWindow  . . . . . . . . . . . . . . . . . 15
  90.              SetCursorDefault  . . . . . . . . . . . . . . . . . . 15
  91.              SetVirtualSize  . . . . . . . . . . . . . . . . . . . 15
  92.              SetWindowModes  . . . . . . . . . . . . . . . . . . . 16
  93.              ShiftB  . . . . . . . . . . . . . . . . . . . . . . . 16
  94.              ShiftW  . . . . . . . . . . . . . . . . . . . . . . . 16
  95.              ShowWindow  . . . . . . . . . . . . . . . . . . . . . 17
  96.              SpanB . . . . . . . . . . . . . . . . . . . . . . . . 17
  97.              SpanRevB  . . . . . . . . . . . . . . . . . . . . . . 17
  98.              SpanRevW  . . . . . . . . . . . . . . . . . . . . . . 17
  99.  
  100.  
  101.                                        2
  102.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  103.  
  104.  
  105.              SpanW . . . . . . . . . . . . . . . . . . . . . . . . 18
  106.              SwapB . . . . . . . . . . . . . . . . . . . . . . . . 18
  107.              SwapBs  . . . . . . . . . . . . . . . . . . . . . . . 18
  108.              SwapW . . . . . . . . . . . . . . . . . . . . . . . . 18
  109.              SwapWs  . . . . . . . . . . . . . . . . . . . . . . . 18
  110.              TitleWindow . . . . . . . . . . . . . . . . . . . . . 18
  111.              VResizeWindow . . . . . . . . . . . . . . . . . . . . 19
  112.              VScrollView . . . . . . . . . . . . . . . . . . . . . 19
  113.              VUpdateCursor . . . . . . . . . . . . . . . . . . . . 19
  114.              VUpdateRows . . . . . . . . . . . . . . . . . . . . . 20
  115.              VUpdateTitles . . . . . . . . . . . . . . . . . . . . 20
  116.              VUpdateView . . . . . . . . . . . . . . . . . . . . . 20
  117.              VUpdateWindow . . . . . . . . . . . . . . . . . . . . 20
  118.              VViewRC . . . . . . . . . . . . . . . . . . . . . . . 21
  119.              VViewRCrel  . . . . . . . . . . . . . . . . . . . . . 21
  120.              VZoomWindow . . . . . . . . . . . . . . . . . . . . . 21
  121.              WEosC . . . . . . . . . . . . . . . . . . . . . . . . 21
  122.              WEosLn  . . . . . . . . . . . . . . . . . . . . . . . 22
  123.              WEosToRC  . . . . . . . . . . . . . . . . . . . . . . 22
  124.              WEosR . . . . . . . . . . . . . . . . . . . . . . . . 22
  125.              WBrdrH  . . . . . . . . . . . . . . . . . . . . . . . 22
  126.              WBrdrPart . . . . . . . . . . . . . . . . . . . . . . 23
  127.              WBrdrV  . . . . . . . . . . . . . . . . . . . . . . . 23
  128.              WClrEol . . . . . . . . . . . . . . . . . . . . . . . 23
  129.              WClrEos . . . . . . . . . . . . . . . . . . . . . . . 23
  130.              WClrField . . . . . . . . . . . . . . . . . . . . . . 24
  131.              WClrFieldEos  . . . . . . . . . . . . . . . . . . . . 24
  132.              WClrLine  . . . . . . . . . . . . . . . . . . . . . . 24
  133.              WClrScr . . . . . . . . . . . . . . . . . . . . . . . 24
  134.              WClrTitle . . . . . . . . . . . . . . . . . . . . . . 25
  135.              WDelLine  . . . . . . . . . . . . . . . . . . . . . . 25
  136.              WGotoEos  . . . . . . . . . . . . . . . . . . . . . . 25
  137.              WGotoRC . . . . . . . . . . . . . . . . . . . . . . . 25
  138.              WInsLine  . . . . . . . . . . . . . . . . . . . . . . 26
  139.              WLineH  . . . . . . . . . . . . . . . . . . . . . . . 26
  140.              WLinePart . . . . . . . . . . . . . . . . . . . . . . 26
  141.              WLineV  . . . . . . . . . . . . . . . . . . . . . . . 27
  142.              WriteAndViewPage  . . . . . . . . . . . . . . . . . . 27
  143.              WriteToCRT  . . . . . . . . . . . . . . . . . . . . . 27
  144.              WriteToHidden . . . . . . . . . . . . . . . . . . . . 27
  145.              WriteToPage . . . . . . . . . . . . . . . . . . . . . 28
  146.              WriteToVirtual  . . . . . . . . . . . . . . . . . . . 28
  147.              WScrollDown . . . . . . . . . . . . . . . . . . . . . 28
  148.              WScrollUp . . . . . . . . . . . . . . . . . . . . . . 28
  149.              WWhereC . . . . . . . . . . . . . . . . . . . . . . . 29
  150.              WWhereR . . . . . . . . . . . . . . . . . . . . . . . 29
  151.              WWrite  . . . . . . . . . . . . . . . . . . . . . . . 29
  152.              WWriteA . . . . . . . . . . . . . . . . . . . . . . . 30
  153.              WWriteAC  . . . . . . . . . . . . . . . . . . . . . . 30
  154.              WWriteC . . . . . . . . . . . . . . . . . . . . . . . 30
  155.              WWriteSub . . . . . . . . . . . . . . . . . . . . . . 31
  156.  
  157.         3. DATA STRUCTURE  . . . . . . . . . . . . . . . . . . . . 32
  158.              Basic Types . . . . . . . . . . . . . . . . . . . . . 32
  159.              Typed Constants . . . . . . . . . . . . . . . . . . . 34
  160.  
  161.  
  162.                                        3
  163.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  164.  
  165.  
  166.              Untyped Constants . . . . . . . . . . . . . . . . . . 35
  167.              Global Variables  . . . . . . . . . . . . . . . . . . 36
  168.              Dynamic Variables . . . . . . . . . . . . . . . . . . 39
  169.  
  170.         APPENDIX A:  MEMORY ALLOCATION . . . . . . . . . . . . . . 40
  171.              Global Memory . . . . . . . . . . . . . . . . . . . . 40
  172.              Dynamic Memory  . . . . . . . . . . . . . . . . . . . 40
  173.              Code Size . . . . . . . . . . . . . . . . . . . . . . 41
  174.  
  175.         APPENDIX B:  ERROR MESSAGES  . . . . . . . . . . . . . . . 42
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.                                        4
  224.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  225.  
  226.  
  227.    1.  I N T R O D U C T I O N
  228.  
  229.  
  230.    PURPOSE
  231.  
  232.    This document is a technical reference manual describing each routine and 
  233.    variable in detail in a format similar to the BP manual.  The routines are 
  234.    described in alphabetical order.  Since this manual is on disk, you can 
  235.    find your interest easily with any search utility.
  236.  
  237.    Application - Because WNDW uses QWIK, all routines will perform in the 
  238.    following applications:
  239.  
  240.      . All video text modes - 0, 1, 2, 3 and 7.
  241.      . Any column mode - 40, 80, or variable.
  242.      . For IBM PC, XT, AT, PCjr, PC convertible, all PS/2 models, 3270 PC, and 
  243.        compatibles.
  244.      . With MDA, CGA, EGA, MCGA, VGA, 8214/A, all Hercules video cards.
  245.      . Perform routines in both absolute and window-relative coordinates.
  246.      . Writes direct to high speed multi-tasking video buffers (MTVB).
  247.  
  248.  
  249.    COMMON PARAMETERS
  250.  
  251.    Common Parameters - Most procedures use the same parameters.  Rather than 
  252.    repeating them for each routine, detailed descriptions for those parameters 
  253.    are listed below.
  254.  
  255.    Window Coordinates - Unless otherwise stated, all WNDW routines work in 
  256.    window-relative coordinates.  For simplicity, virtual routines check for 
  257.    bounds to keep routines confined to the windows and screen.  However, to be 
  258.    fast, some other routines indicated in this document do not check for 
  259.    bounds in the windows or on the screen, so be sure to stay in range.  The 
  260.    upper left column in a window is row 1, column 1, which is also called a 
  261.    1-based coordinate system.
  262.  
  263.    Row/Col - Row and Col were chosen in lieu of the X/Y scheme used in TP.  
  264.    Since WNDW is for only text modes, the screen is treated like a word 
  265.    processor with rows and columns.  It is more intuitive to use the X/Y 
  266.    scheme in graphics and the Row/Col scheme for text.
  267.  
  268.    Rows/Cols - Using Rows/Cols is much easier than Row2/Col2 to describe the 
  269.    height and width of a block such as:
  270.  
  271.       MakeWindow (Row,Col,Rows,Cols,Wattr,Battr,Border,Name);
  272.  
  273.    Should you decide to move the window, only Row and Col need to be changed, 
  274.    and therefore Rows and Cols don't need to be mentally recalculated and 
  275.    altered.  Please keep Cols limited to one row.
  276.  
  277.    NumOfRows/NumOfCols - These parameters indicate a relative shift from a 
  278.    given point that can be positive or negative.
  279.  
  280.    aStr - The window-relative writing routines like WWrite and WWriteC 
  281.    actually use QWIK to write this string.  There is only on line of code for 
  282.  
  283.  
  284.    Chapter 1, Introduction                                             Page 5
  285.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  286.  
  287.  
  288.    these routines since they just relocate where QWIK is suppose to write in 
  289.    the window. 
  290.  
  291.  
  292.    ATTRIBUTES
  293.  
  294.    *Attr - Use the convenient attribute constants for the foreground and 
  295.    background colors supplied in the QWIK unit rather than having to use TP 
  296.    functions or procedures to get a desired color, for example:
  297.     
  298.      MakeWindow (1,1,8,8,White+BlueBG,Yellow+BlueBG,SingleBrdr,aWindow)
  299.  
  300.    will make a window with a white on blue window and yellow on blue border.  
  301.    All subsequent routines will use these attributes for writing.  TextAttr is 
  302.    also set to the window attribute in case the Turbo write routines are used.  
  303.    The foreground constants in QWIK are duplicates of those in the CRT unit 
  304.    and are repeated here for convenience:
  305.  
  306.      Black        = $00;       DarkGray     = $08;
  307.      Blue         = $01;       LightBlue    = $09;
  308.      Green        = $02;       LightGreen   = $0A;
  309.      Cyan         = $03;       LightCyan    = $0B;
  310.      Red          = $04;       LightRed     = $0C;
  311.      Magenta      = $05;       LightMagenta = $0D;
  312.      Brown        = $06;       Yellow       = $0E;
  313.      LightGray    = $07;       White        = $0F;
  314.      Blink        = $80;                          
  315.  
  316.    In addition, the QWIK background color constants were included to take 
  317.    advantage of constant folding.
  318.  
  319.      BlackBG      = $00;    
  320.      BlueBG       = $10;    
  321.      GreenBG      = $20;    
  322.      CyanBG       = $30;    
  323.      RedBG        = $40;    
  324.      MagentaBG    = $50;    
  325.      BrownBG      = $60;    
  326.      LightGrayBG  = $70;    
  327.      SameAttr     =  -1;  
  328.  
  329.    SameAttr - A powerful and unique feature of all WNDW routines is the use of 
  330.    the constant SameAttr.  If SameAttr, or a negative value, is used as an 
  331.    attribute, the routine will suppress any changes to the attributes and use 
  332.    what is currently on the screen.
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.    Chapter 1, Introduction                                             Page 6
  346.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  347.  
  348.  
  349.    2.  P R O C E D U R E S   A N D   F U N C T I O N S
  350.  
  351.    In this section, a detailed description is provided for each procedure and 
  352.    function.
  353.  
  354.  
  355.    ---------------------------------------------------------------------------
  356.    AccessWindow procedure                                                 Wndw
  357.    ---------------------------------------------------------------------------
  358.    Function       Randomly accesses a covered window and places it on the top.  
  359.                   If the window is hidden, it uses ShowWindow to put it on 
  360.                   top.
  361.    Declaration    AccessWindow (WindowName: WindowNames)
  362.    Screens        All video pages.
  363.    Remarks        All underlays are properly updated in the heap with a high 
  364.                   speed technique.  If NoAccessMode has been set for this 
  365.                   window or an invalid window name is used, the procedure is 
  366.                   simply ignored.  Virtual windows are updated after being 
  367.                   shown.  Zoom effect is optional.  The WndwStats are shuffled 
  368.                   to match the new levels.
  369.    Restrictions   Shadows are fully supported.  For human factors, opaque 
  370.                   shadows are only recommended for the top window only.
  371.    EOS            Restored to new window.
  372.    Heap           Temporarily uses (underlay size * 1.5).
  373.    Exit           Forced to write to CRT.
  374.    See also       HideWindow, ShowWindow
  375.  
  376.    ---------------------------------------------------------------------------
  377.    ChangeBorder procedure                                                 Wndw
  378.    ---------------------------------------------------------------------------
  379.    Function       Changes the border to a new border style.
  380.    Declaration    ChangeBorder (NewBrdr: Borders)
  381.    Screens        All video pages.
  382.    Remarks        The original border style is already saved in ViewBrdr.  The 
  383.                   current border is changed by searching for a match of WSbrdr 
  384.                   for each border part with the current attribute.  If a match 
  385.                   is found, it is replaced with NewBrdr.  Tees as well as 
  386.                   virtual borders are also replaced.  The original border can 
  387.                   later be restored with RestoreBorder. 
  388.    EOS            Restored to CRT.
  389.    Exit           Forced to write to CRT.
  390.    Restrictions   NoBrdr is ignored as either the original or new border.
  391.    See also       RestoreBorder
  392.  
  393.    ---------------------------------------------------------------------------
  394.    FillB procedure                                                       Wutil
  395.    ---------------------------------------------------------------------------
  396.    Function       Fill a block of memory with a repeated character.
  397.    Declaration    FillB (var Dest; NumOfBytes: word; aByte: byte)
  398.    Remarks        Up to twice as fast as System.FillChar.
  399.    See also       FillC, FillW.
  400.   
  401.  
  402.  
  403.  
  404.  
  405.  
  406.    Chapter 2, Procedures and Functions                                 Page 7
  407.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  408.  
  409.  
  410.    ---------------------------------------------------------------------------
  411.    FillC procedure                                                       Wutil
  412.    ---------------------------------------------------------------------------
  413.    Function       Fill a block of memory with a repeated character.
  414.    Declaration    FillC (var Dest; NumOfChars: word; aChar: char)
  415.    Remarks        Up to twice as fast as System.FillChar.
  416.    See also       FillB, FillW.
  417.   
  418.    ---------------------------------------------------------------------------
  419.    FillW procedure                                                       Wutil
  420.    ---------------------------------------------------------------------------
  421.    Function       Fill a block of memory with a repeated character.
  422.    Declaration    FillW (var Dest; NumOfWords, aWord: word)
  423.    Remarks        Up to twice as fast as System.FillChar.
  424.    See also       FillB, FillC.
  425.   
  426.    ---------------------------------------------------------------------------
  427.    FindB procedure                                                       Wutil
  428.    ---------------------------------------------------------------------------
  429.    Function       Finds the first match of a byte in memory.
  430.    Declaration    FindB (var aPtr; Find: byte; MaxBytes: word)
  431.    Result type    word
  432.    Remarks        Returns a 1-based result  pointing to the position (not 
  433.                   offset) of the Find.  The variable aPtr points to Byte 1.  
  434.                   A zero result means no match was found.  Maximum size to 
  435.                   search is 64k of bytes.
  436.    See also       FindRevB, FindRevW, FindW
  437.   
  438.    ---------------------------------------------------------------------------
  439.    FindRevB procedure                                                    Wutil
  440.    ---------------------------------------------------------------------------
  441.    Function       Finds the first match of a byte in memory scanning in 
  442.                   reverse.
  443.    Declaration    FindRevB (var aPtr; Find: byte; MaxBytes: word)
  444.    Result type    word
  445.    Remarks        Returns a 1-based result  pointing to the position (not 
  446.                   offset) of the Find.  The variable aPtr points to Byte 1.  
  447.                   A zero result means no match was found.  Maximum size to 
  448.                   search is 64k of bytes.
  449.    See also       FindB, FindRevW, FindW
  450.   
  451.    ---------------------------------------------------------------------------
  452.    FindRevW procedure                                                    Wutil
  453.    ---------------------------------------------------------------------------
  454.    Function       Finds the first match of a word in memory scanning in 
  455.                   reverse.
  456.    Declaration    FindRevW (var aPtr; Find: word; MaxWords: word)
  457.    Result type    word
  458.    Remarks        Returns a 1-based result  pointing to the position (not 
  459.                   offset) of the Find.  The variable aPtr points to Byte 1.  
  460.                   A zero result means no match was found.  Maximum size to 
  461.                   search is 32k of words.
  462.    See also       FindB, FindRevB, FindW
  463.   
  464.  
  465.  
  466.  
  467.    Chapter 2, Procedures and Functions                                 Page 8
  468.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  469.  
  470.  
  471.    ---------------------------------------------------------------------------
  472.    FindW procedure                                                       Wutil
  473.    ---------------------------------------------------------------------------
  474.    Function       Finds the first match of a word in memory.
  475.    Declaration    FindB (var aPtr; Find: word; MaxWords: word)
  476.    Result type    word
  477.    Remarks        Returns a 1-based result  pointing to the position (not 
  478.                   offset) of the Find.  The variable aPtr points to Byte 1.  
  479.                   A zero result means no match was found.  Maximum size to 
  480.                   search is 32k of words.
  481.    See also       FindRevB, FindRevW, FindB
  482.   
  483.    ---------------------------------------------------------------------------
  484.    GetLevelIndex function                                                 Wndw
  485.    ---------------------------------------------------------------------------
  486.    Function       Returns the WndwStat index given the WindowName.
  487.    Declaration    GetLevelIndex (WindowName: WindowNames)
  488.    Result type    word
  489.    Remarks        This routine scans for the first matching WindowName.  It 
  490.                   scans from the top level index (LI) first and then down.  
  491.                   Hidden windows from the hidden level index (HLI) up are 
  492.                   scanned last.  If no match is found, the result is >MaxWndw.
  493.  
  494.    ---------------------------------------------------------------------------
  495.    HeapOK function                                                        Wndw
  496.    ---------------------------------------------------------------------------
  497.    Function       Returns TRUE if enough heap is available from MaxAvail.
  498.    Declaration    HeapOK (NumOfBytes: word)
  499.    Result type    boolean
  500.    Remarks        If there is insufficient heap, the program terminates 
  501.                   through the GOOF unit.  The error window will display 
  502.                   MemAvail and MaxAvail.  All WNDW procedures that use the 
  503.                   heap run this routine.
  504.  
  505.    ---------------------------------------------------------------------------
  506.    HideWindow procedure                                                   Wndw
  507.    ---------------------------------------------------------------------------
  508.    Function       Hides the current top window on the CRT.
  509.    Declaration    HideWindow
  510.    Screens        All video pages.
  511.    Remarks        The window is saved in RAM and the underlay is restored on 
  512.                   the screen showing the new top window.  If NoHideMode has 
  513.                   been set for this window, the procedure is ignored.  The 
  514.                   windows are saved with the border, but without any shadow.
  515.    EOS            Altered to (Wrow,Wcol) before hiding, then restored to the 
  516.                   new top window.  
  517.    Heap           Temporarily uses (underlay size * 1.5).
  518.    Exit           Forced to write to CRT.
  519.    See also       ShowWindow
  520.  
  521.    ---------------------------------------------------------------------------
  522.    InitWindow procedure                                                   Wndw
  523.    ---------------------------------------------------------------------------
  524.    Function       Initializes global data for WNDW routines.  In brief, it 
  525.                   sets the defaults for WndwStat, indexes and margins for each 
  526.  
  527.  
  528.    Chapter 2, Procedures and Functions                                 Page 9
  529.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  530.  
  531.  
  532.                   video page.
  533.    Declaration    InitWindow (Wattr: integer; ClearScr: boolean);
  534.    Remarks        This is the first routine required to executed early in the 
  535.                   main program and only needs to be done once.  Wattr is the 
  536.                   attribute for the full screen (Window0) for all video pages.  
  537.                   If ClearScr is true, then all video pages are cleared with 
  538.                   Wattr.  Over 50 variables are initialized with this 
  539.                   procedure.  See InitWindow source code for details.
  540.    EOS            Set to (1,1).
  541.    Heap           Allocates VirtualStat and PageStat arrays as required.
  542.    See also       SetCursorDefault, WNDW70A.DOC and Data Structure section.
  543.  
  544.    ---------------------------------------------------------------------------
  545.    InRangeB function                                                     Wutil
  546.    ---------------------------------------------------------------------------
  547.    Function       Returns true if a byte value is in between upper and lower 
  548.                   limits inclusive.
  549.    Declaration    InRangeB (Lower,Value,Upper: byte)
  550.    Result type    boolean
  551.    Remarks        High speed evaluation written in assembler.
  552.    See also       InRangeI, InRangeL, InRangeW, Limit*
  553.   
  554.    ---------------------------------------------------------------------------
  555.    InRangeI function                                                     Wutil
  556.    ---------------------------------------------------------------------------
  557.    Function       Returns true if an integer value is in between upper and 
  558.                   lower limits inclusive.
  559.    Declaration    InRangeI (Lower,Value,Upper: integer)
  560.    Result type    boolean
  561.    Remarks        High speed evaluation written in assembler.
  562.    See also       InRangeB, InRangeL, InRangeW, Limit*
  563.   
  564.    ---------------------------------------------------------------------------
  565.    InRangeL function                                                     Wutil
  566.    ---------------------------------------------------------------------------
  567.    Function       Returns true if a longint value is in between upper and 
  568.                   lower limits inclusive.
  569.    Declaration    InRangeL (Lower,Value,Upper: longint)
  570.    Result type    boolean
  571.    Remarks        High speed evaluation written in assembler.
  572.    See also       InRangeI, InRangeL, InRangeW, Limit*
  573.   
  574.    ---------------------------------------------------------------------------
  575.    InRangeW function                                                     Wutil
  576.    ---------------------------------------------------------------------------
  577.    Function       Returns true if a word value is in between upper and lower 
  578.                   limits inclusive.
  579.    Declaration    InRangeW (Lower,Value,Upper: word)
  580.    Result type    boolean
  581.    Remarks        High speed evaluation written in assembler.
  582.    See also       InRangeB, InRangeI, InRangeL, Limit*
  583.   
  584.  
  585.  
  586.  
  587.  
  588.  
  589.    Chapter 2, Procedures and Functions                                 Page 10
  590.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  591.  
  592.  
  593.    ---------------------------------------------------------------------------
  594.    LimitB function                                                       Wutil
  595.    ---------------------------------------------------------------------------
  596.    Function       Returns a byte value bounded by upper and lower limits 
  597.                   inclusive.
  598.    Declaration    LimitB (Lower,Value,Upper: byte)
  599.    Result type    byte
  600.    Remarks        High speed evaluation written in assembler.
  601.    See also       InRange*, LimitI, LimitL, LimitW
  602.   
  603.    ---------------------------------------------------------------------------
  604.    LimitI function                                                       Wutil
  605.    ---------------------------------------------------------------------------
  606.    Function       Returns an integer value bounded by upper and lower limits 
  607.                   inclusive.
  608.    Declaration    LimitI (Lower,Value,Upper: integer)
  609.    Result type    integer
  610.    Remarks        High speed evaluation written in assembler.
  611.    See also       InRange*, LimitB, LimitL, LimitW
  612.   
  613.    ---------------------------------------------------------------------------
  614.    LimitL function                                                       Wutil
  615.    ---------------------------------------------------------------------------
  616.    Function       Returns a longint value bounded by upper and lower limits 
  617.                   inclusive.
  618.    Declaration    LimitL (Lower,Value,Upper: longint)
  619.    Result type    longint
  620.    Remarks        High speed evaluation written in assembler.
  621.    See also       InRange*, LimitB, LimitI, LimitW
  622.   
  623.    ---------------------------------------------------------------------------
  624.    LimitW function                                                       Wutil
  625.    ---------------------------------------------------------------------------
  626.    Function       Returns a word value bounded by upper and lower limits 
  627.                   inclusive.
  628.    Declaration    LimitW (Lower,Value,Upper: word)
  629.    Result type    word
  630.    Remarks        High speed evaluation written in assembler.
  631.    See also       InRange*, LimitB, LimitI, LimitL
  632.   
  633.    ---------------------------------------------------------------------------
  634.    LocateCursor procedure                                                 Wndw
  635.    ---------------------------------------------------------------------------
  636.    Function       Locates the cursor within the window.
  637.    Declaration    LocateCursor
  638.    Screens        All video pages.
  639.    Remarks        This routine, a subroutine of RestoreTurboWindow, locates 
  640.                   the cursor as set in the WndwStat for fixed or virtual 
  641.                   windows.  It is usually handled automatically, but is 
  642.                   available for handling exceptions.  VUpdateCursor is a 
  643.                   subroutine of LocateCursor.
  644.    See also       RestoreTurboWindow, VUpdateCursor
  645.  
  646.  
  647.  
  648.  
  649.  
  650.    Chapter 2, Procedures and Functions                                 Page 11
  651.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  652.  
  653.  
  654.    ---------------------------------------------------------------------------
  655.    MakeWindow procedure                                                   Wndw
  656.    ---------------------------------------------------------------------------
  657.    Function       Makes a window.
  658.    Declaration    MakeWindow (Row,Col,Rows,Cols: byte; Wattr,Battr: integer;
  659.                               BrdrSel: Borders; WindowName: WindowNames)
  660.    Screens        All video pages.
  661.    Remarks        This is the main routine to create windows.  Row, Col, Row, 
  662.                   and Rows is the absolute coordinates for the window 
  663.                   inclusive of any border.  For RelMode, (Row,Col) is window 
  664.                   relative.  Wattr and Battr are the window and border 
  665.                   attributes, respectively (SameAttr is permitted).  BrdrSel 
  666.                   is the selection of one of 15 different borders.  WindowName 
  667.                   is a unique window name required for random access. 
  668.    EOS            Set to (1,1).
  669.    Heap           Allocates underlay size until removed.
  670.    Restrictions   Minimum size - (1x1) without borders, (3x3) with borders. 
  671.    See also       SetWindowModes, RemoveWindow
  672.  
  673.    ---------------------------------------------------------------------------
  674.    MaxB function                                                         Wutil
  675.    ---------------------------------------------------------------------------
  676.    Function       Returns the maximum value of two bytes.
  677.    Declaration    MaxB (Value1,Value2: byte)
  678.    Result type    byte
  679.    Remarks        High speed evaluation of two bytes.
  680.    See also       MaxI, MaxL, MaxW, MinB, MinI, MinL, MinW
  681.   
  682.    ---------------------------------------------------------------------------
  683.    MaxI function                                                         Wutil
  684.    ---------------------------------------------------------------------------
  685.    Function       Returns the maximum value of two integers.
  686.    Declaration    MaxI (Value1,Value2: integer)
  687.    Result type    integer
  688.    Remarks        High speed evaluation of two integers.
  689.    See also       MaxB, MaxL, MaxW, MinB, MinI, MinL, MinW
  690.   
  691.    ---------------------------------------------------------------------------
  692.    MaxL function                                                         Wutil
  693.    ---------------------------------------------------------------------------
  694.    Function       Returns the maximum value of two long integers.
  695.    Declaration    MaxI (Value1,Value2: longint)
  696.    Result type    longint
  697.    Remarks        High speed evaluation of two long integers.
  698.    See also       MaxB, MaxI, MaxW, MinB, MinI, MinL, MinW
  699.   
  700.    ---------------------------------------------------------------------------
  701.    MaxW function                                                         Wutil
  702.    ---------------------------------------------------------------------------
  703.    Function       Returns the maximum value of two words.
  704.    Declaration    MaxW (Value1,Value2: word)
  705.    Result type    word
  706.    Remarks        High speed evaluation of two words.
  707.    See also       MaxB, MaxI, MaxL, MinB, MinI, MinL, MinW
  708.   
  709.  
  710.  
  711.    Chapter 2, Procedures and Functions                                 Page 12
  712.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  713.  
  714.  
  715.    ---------------------------------------------------------------------------
  716.    MinB function                                                         Wutil
  717.    ---------------------------------------------------------------------------
  718.    Function       Returns the minimum value of two bytes.
  719.    Declaration    MinI (Value1,Value2: byte)
  720.    Result type    byte
  721.    Remarks        High speed evaluation of two bytes.
  722.    See also       MaxB, MaxI, MaxL, MaxW, MinI, MinL, MinW
  723.   
  724.    ---------------------------------------------------------------------------
  725.    MinI function                                                         Wutil
  726.    ---------------------------------------------------------------------------
  727.    Function       Returns the minimum value of two integers.
  728.    Declaration    MinI (Value1,Value2: integer)
  729.    Result type    integer
  730.    Remarks        High speed evaluation of two integers.
  731.    See also       MaxB, MaxI, MaxL, MaxW, MinB, MinL, MinW
  732.   
  733.    ---------------------------------------------------------------------------
  734.    MinL function                                                         Wutil
  735.    ---------------------------------------------------------------------------
  736.    Function       Returns the minimum value of two long integers.
  737.    Declaration    MinI (Value1,Value2: longint)
  738.    Result type    longint
  739.    Remarks        High speed evaluation of two long integers.
  740.    See also       MaxB, MaxI, MaxL, MaxW, MinB, MinI, MinW
  741.   
  742.    ---------------------------------------------------------------------------
  743.    MinW function                                                         Wutil
  744.    ---------------------------------------------------------------------------
  745.    Function       Returns the minimum value of two words.
  746.    Declaration    MinW (Value1,Value2: word)
  747.    Result type    word
  748.    Remarks        High speed evaluation of two words.
  749.    See also       MaxB, MaxI, MaxL, MaxW, MinB, MinI, MinL
  750.   
  751.    ---------------------------------------------------------------------------
  752.    MoveWindow procedure                                                   Wndw
  753.    ---------------------------------------------------------------------------
  754.    Function       Moves the current top window on the CRT a relative number of 
  755.                   rows and columns.
  756.    Declaration    MoveWindow (NumOfRows,NumOfCols: integer)
  757.    Screens        All video pages.
  758.    Remarks        If NoMoveMode or PermMode has been set for this window, the 
  759.                   procedure is ignored.  Shadows are fully supported.  Margins 
  760.                   are respected.
  761.    EOS            Moved relatively to the same place.
  762.    Heap           Maximum requirement is full screen size plus the underlay 
  763.                   size.
  764.    Exit           Forced to write to CRT.
  765.    See also       ShowWindow
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.    Chapter 2, Procedures and Functions                                 Page 13
  773.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  774.  
  775.  
  776.    ---------------------------------------------------------------------------
  777.    MoveB procedure                                                       Wutil
  778.    ---------------------------------------------------------------------------
  779.    Function       Copies a specified number of contiguous bytes from a source 
  780.                   to a destination in memory.
  781.    Declaration    MoveB (VAR Source,Dest; NumOfBytes: word)
  782.    Remarks        Use 16-bit transfers and does not check for overlap.  Faster 
  783.                   than ShiftB.
  784.    Restrictions   Source and Dest[0] must not overlap.  
  785.    See also       MoveW, ShiftB, ShiftW
  786.   
  787.    ---------------------------------------------------------------------------
  788.    MoveW procedure                                                       Wutil
  789.    ---------------------------------------------------------------------------
  790.    Function       Copies a specified number of contiguous words from a source 
  791.                   to a destination in memory.
  792.    Declaration    MoveW (VAR Source,Dest; NumOfWords: word)
  793.    Remarks        Uses 16-bit transfers and does not check for overlap.  
  794.                   Faster than ShiftW.
  795.    Restrictions   Source and Dest[0] must not overlap.  
  796.    See also       MoveB, ShiftB, ShiftW
  797.   
  798.    ---------------------------------------------------------------------------
  799.    RemoveWindow procedure                                                 Wndw
  800.    ---------------------------------------------------------------------------
  801.    Function       Removes the current top window on the CRT.
  802.    Declaration    RemoveWindow 
  803.    Screens        All video pages.
  804.    Remarks        Basically, the top window is removed restoring the underlay 
  805.                   and then erased from memory.  Depending on the window mode, 
  806.                   RemoveWindow responds differently:
  807.  
  808.                     RelMode     - The window-relative stats are simply 
  809.                                   replaced with the parent window stats.
  810.                     PermMode    - The stats are simply dropped from the stack.
  811.                     VirtualMode - The virtual screen is additionally removed 
  812.                                   from the heap.
  813.  
  814.    EOS            Restored to the new top window.
  815.    Heap           Deallocates the underlay.
  816.    Exit           Forced to write to CRT.
  817.    See also       MakeWindow
  818.  
  819.    ---------------------------------------------------------------------------
  820.    RestoreBorder procedure                                                Wndw
  821.    ---------------------------------------------------------------------------
  822.    Function       Restores the border to the original border style.
  823.    Declaration    RestoreBorder
  824.    Screens        All video pages.
  825.    Remarks        Reverses the effect of ChangeBorder by replacing the current 
  826.                   border style back to the original.
  827.    EOS            Restored to CRT.
  828.    Exit           Forced to write to CRT.
  829.    See also       ChangeBorder
  830.  
  831.  
  832.  
  833.    Chapter 2, Procedures and Functions                                 Page 14
  834.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  835.  
  836.  
  837.    ---------------------------------------------------------------------------
  838.    RestoreTurboWindow procedure                                           Wndw
  839.    ---------------------------------------------------------------------------
  840.    Function       Restores attributes, cursor, and EOS marker for the current 
  841.                   window.
  842.    Declaration    RestoreTurboWindow
  843.    Screens        All video pages.
  844.    Remarks        Usually this procedure is handled automatically.  If there 
  845.                   is some exception in handling, then this procedure can be 
  846.                   used.  It does the following:
  847.  
  848.                     . Resets TextAttr and ScrollAttr to OrigAttr
  849.                     . Restores Turbo window
  850.                     . Reset EOS marker to last saved location
  851.                     . Resets cursor mode 
  852.                     . Locates cursor with LocateCursor
  853.  
  854.    EOS            Restored.
  855.    See also       LocateCursor
  856.  
  857.    ---------------------------------------------------------------------------
  858.    SetCursorDefault procedure                                             Wndw
  859.    ---------------------------------------------------------------------------
  860.    Function       Sets the default cursor mode to be used by MakeWindow.
  861.    Declaration    SetCursorDefault (CursorMode: word)
  862.    Remarks        This routine simply assigns a value to the global variable 
  863.                   CursorDefault.  This value is already assigned by InitWindow 
  864.                   to the current cursor mode.  If a specific cursor mode is 
  865.                   required for the initial window as well, use Qwik.SetCursor 
  866.                   instead before InitWindow.
  867.    See also       InitWindow, MakeWindow
  868.  
  869.    ---------------------------------------------------------------------------
  870.    SetVirtualSize procedure                                               Wndw
  871.    ---------------------------------------------------------------------------
  872.    Function       Sets the dimensions for the virtual screen of virtual 
  873.                   windows.
  874.    Declaration    SetVirtualSize (Rows,Cols: byte)
  875.    Remarks        This optional procedure sets the rows-by-columns dimensions 
  876.                   for a virtual screen.  Keep in mind that two additional rows 
  877.                   will be internally added for titles if borders are used.  
  878.                   The default at startup is the CRT screen size.  
  879.    Restrictions   Maximum buffer size is 64k.
  880.    See also       MakeWindow
  881.    Example        Set the size for a virtual screen with 80 columns and a 
  882.                   maximum number of rows:
  883.  
  884.                     SetVirtualSize (253,80);
  885.  
  886.                   The resulting size would be (253+2)*80*2 = 40,800 bytes 
  887.                   which is under 64k.  Rows 254 and 255 would be reserved for 
  888.                   top and bottom titles on the border.
  889.  
  890.  
  891.  
  892.  
  893.  
  894.    Chapter 2, Procedures and Functions                                 Page 15
  895.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  896.  
  897.  
  898.    ---------------------------------------------------------------------------
  899.    SetWindowModes procedure                                               Wndw
  900.    ---------------------------------------------------------------------------
  901.    Function       Sets the window modes to be used by MakeWindow.
  902.    Declaration    SetWindowModes (SumOfAllModes: word)
  903.    Remarks        There are several different modes that can be used:
  904.  
  905.       RelMode       - Window-relative frame of reference, no underlay
  906.       PermMode      - Can't be moved or removed, no underlay
  907.       ShadowLeft    - Shadow on the left side
  908.       ShadowRight   - Shadow on the right side
  909.       ShadowTrans   - Produces transparent rather than opaque shadows
  910.       ZoomMode      - Zoom effect on Make, Show and AccessWindow
  911.       HiddenMode    - Create window as hidden
  912.       VirtualMode   - Create virtual screen as well
  913.       CursorOffMode - Leaves cursor off for window
  914.       SeeThruMode   - Doesn't clear area inside window
  915.       NoHideMode    - Ignores request to hide window
  916.       NoAccessMode  - Ignores request to access window
  917.       NoMoveMode    - Ignores request to move/resize window
  918.  
  919.                   The startup mode is equivalent to zero while the base window 
  920.                   is PermMode.  The modes should be summed logically, but can 
  921.                   also be done arithmetically with care.  All PermMode windows 
  922.                   must be created first.
  923.    See also       MakeWindow
  924.    Example        Set the modes for the next window to have a right shadow, 
  925.                   zoom effect, cursor off, and a virtual screen:
  926.  
  927.                     SetWindowModes (ShadowRight or ZoomMode or CursorOffMode
  928.                                     or VirtualMode);
  929.  
  930.    Example        Set the modes back to defaults:
  931.  
  932.                     SetWindowModes (0);
  933.  
  934.    ---------------------------------------------------------------------------
  935.    ShiftB procedure                                                      Wutil
  936.    ---------------------------------------------------------------------------
  937.    Function       Copies a specified number of contiguous bytes from a source 
  938.                   to a destination in memory.
  939.    Declaration    ShiftB (VAR Source,Dest; NumOfBytes: word)
  940.    Remarks        Exactly like TP's Move except twice as fast by using 16-bit 
  941.                   transfers.  Checks for overlap.  Use in lieu of Move.
  942.    See also       MoveB, MoveW, ShiftW
  943.   
  944.    ---------------------------------------------------------------------------
  945.    ShiftW procedure                                                      Wutil
  946.    ---------------------------------------------------------------------------
  947.    Function       Copies a specified number of contiguous words from a source 
  948.                   to a destination in memory.
  949.    Declaration    ShiftW (VAR Source,Dest; NumOfWords: word)
  950.    Remarks        Uses 16-bit transfers and checks for overlap.
  951.    See also       MoveB, MoveW, ShiftB
  952.   
  953.  
  954.  
  955.    Chapter 2, Procedures and Functions                                 Page 16
  956.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  957.  
  958.  
  959.    ---------------------------------------------------------------------------
  960.    ShowWindow procedure                                                   Wndw
  961.    ---------------------------------------------------------------------------
  962.    Function       Shows a hidden window to become the current top window on 
  963.                   the CRT.
  964.    Declaration    ShowWindow (WindowName: WindowNames)
  965.    Screens        All video pages.
  966.    Remarks        The underlay is saved from the screen and the window is 
  967.                   restored from RAM to become the new top window.  Invalid 
  968.                   window names are simply ignored.  Virtual windows are 
  969.                   updated before being shown.  Zoom effect is optional.
  970.    EOS            Set to (1,1).
  971.    Heap           Temporarily uses (underlay size * 1.5).
  972.    Exit           Forced to write to CRT.
  973.    See also       HideWindow, AccessWindow
  974.  
  975.    ---------------------------------------------------------------------------
  976.    SpanB procedure                                                       Wutil
  977.    ---------------------------------------------------------------------------
  978.    Function       Returns the number of consecutive bytes in memory.
  979.    Declaration    SpanB (var aPtr; Find: byte; MaxBytes: word)
  980.    Result type    word
  981.    Remarks        Returns a 0-based result of how many identical Finds can be 
  982.                   spanned until the first non-match is found.  The result can 
  983.                   also be used as the offset (not position) from aPtr to the 
  984.                   non-match.  The variable aPtr points to byte 0.  A zero 
  985.                   result means no span.  Maximum count is the size of one 
  986.                   segment or 64k.
  987.    See also       SpanRevB, SpanRevW, SpanW
  988.   
  989.    ---------------------------------------------------------------------------
  990.    SpanRevB procedure                                                    Wutil
  991.    ---------------------------------------------------------------------------
  992.    Function       Returns the number of consecutive bytes in memory scanning 
  993.                   in reverse.
  994.    Declaration    SpanRevB (var aPtr; Find: byte; MaxBytes: word)
  995.    Result type    word
  996.    Remarks        Returns a 0-based result of how many identical Finds can be 
  997.                   spanned until the first non-match is found.  The result can 
  998.                   also be used as the offset (not position) from aPtr to the 
  999.                   non-match.  The variable aPtr points to byte 0.  A zero 
  1000.                   result means no span.  Maximum count is the size of one 
  1001.                   segment or 64k.
  1002.    See also       SpanB, SpanRevW, SpanW
  1003.   
  1004.    ---------------------------------------------------------------------------
  1005.    SpanRevW procedure                                                    Wutil
  1006.    ---------------------------------------------------------------------------
  1007.    Function       Returns the number of consecutive words in memory scanning 
  1008.                   in reverse.
  1009.    Declaration    SpanRevW (var aPtr; Find: byte; MaxWords: word)
  1010.    Result type    word
  1011.    Remarks        Returns a 0-based result of how many identical Finds can be 
  1012.                   spanned until the first non-match is found.  The result can 
  1013.                   also be used as the offset (not position) from aPtr to the 
  1014.  
  1015.  
  1016.    Chapter 2, Procedures and Functions                                 Page 17
  1017.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1018.  
  1019.  
  1020.                   non-match.  The variable aPtr points to word 0.  A zero 
  1021.                   result means no span.  Maximum count is 32k words.
  1022.    See also       SpanB, SpanRevB, SpanW
  1023.   
  1024.    ---------------------------------------------------------------------------
  1025.    SpanW procedure                                                       Wutil
  1026.    ---------------------------------------------------------------------------
  1027.    Function       Returns the number of consecutive words in memory.
  1028.    Declaration    SpanB (var aPtr; Find: byte; MaxWords: word)
  1029.    Result type    word
  1030.    Remarks        Returns a 0-based result of how many identical Finds can be 
  1031.                   spanned until the first non-match is found.  The result can 
  1032.                   also be used as the offset (not position) from aPtr to the 
  1033.                   non-match.  The variable aPtr points to word 0.  A zero 
  1034.                   result means no span.  Maximum count is 32k words.
  1035.    See also       SpanRevB, SpanRevW, SpanW
  1036.   
  1037.    ---------------------------------------------------------------------------
  1038.    SwapB procedure                                                       Wutil
  1039.    ---------------------------------------------------------------------------
  1040.    Function       Swaps a single byte between two locations in memory.
  1041.    Declaration    SwapB (var Var1,Var2)
  1042.    Remarks        Works best for values in the heap.
  1043.    See also       SwapBs, SwapW, SwapWs
  1044.   
  1045.    ---------------------------------------------------------------------------
  1046.    SwapBs procedure                                                      Wutil
  1047.    ---------------------------------------------------------------------------
  1048.    Function       Swaps a block of bytes between two locations in memory.
  1049.    Declaration    SwapBs (var Var1,Var2; NumOfBytes: word)
  1050.    Remarks        Swaps the blocks without using temporary memory.
  1051.    See also       SwapB, SwapW, SwapWs
  1052.   
  1053.    ---------------------------------------------------------------------------
  1054.    SwapW procedure                                                       Wutil
  1055.    ---------------------------------------------------------------------------
  1056.    Function       Swaps a single word between two locations in memory.
  1057.    Declaration    SwapBs (var Var1,Var2)
  1058.    Remarks        Works best for values in the heap.
  1059.    See also       SwapB, SwapBs, SwapWs
  1060.   
  1061.    ---------------------------------------------------------------------------
  1062.    SwapWs procedure                                                      Wutil
  1063.    ---------------------------------------------------------------------------
  1064.    Function       Swaps a block of words between two locations in memory.
  1065.    Declaration    SwapWs (var Var1,Var2; NumOfWords: word)
  1066.    Remarks        Swaps the blocks without using temporary memory.
  1067.    See also       SwapB, SwapBs, SwapW
  1068.   
  1069.    ---------------------------------------------------------------------------
  1070.    TitleWindow procedure                                                  Wndw
  1071.    ---------------------------------------------------------------------------
  1072.    Function       Places a title on the current window.
  1073.    Declaration    TitleWindow (TopOrBottom,Justify: DirType;
  1074.                                TitleAttr: integer; Title: string);
  1075.  
  1076.  
  1077.    Chapter 2, Procedures and Functions                                 Page 18
  1078.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1079.  
  1080.  
  1081.    Screens        All video pages.
  1082.    Remarks        There are six positions where the title can be placed in any 
  1083.                   combination of Top or Bottom, and Left, Center, or Right.  
  1084.                   TitleAttr is the title attribute (SameAttr is permitted).  
  1085.                   The titles can be written to hidden windows or virtual 
  1086.                   screens as well.  TitleOfs can be adjusted for 
  1087.                   justification.
  1088.    EOS            Unaltered.
  1089.    See also       TitleOfs in Data Structure section.
  1090.  
  1091.    ---------------------------------------------------------------------------
  1092.    VResizeWindow procedure                                                Wndw
  1093.    ---------------------------------------------------------------------------
  1094.    Function       Resizes the current top virtual window.
  1095.    Declaration    VResizeWindow (NumOfRows,NumOfCols: integer)
  1096.    Remarks        The top window is resized by moving the right and/or bottom 
  1097.                   border.  If NoMoveMode or PermMode has been set for this 
  1098.                   window, the procedure is ignored.  Shadows are fully 
  1099.                   supported.  Margins are respected.
  1100.    Heap           Maximum requirement is full screen size plus the underlay 
  1101.                   size.
  1102.    Exit           Forced to write to CRT.
  1103.    Restrictions   None.
  1104.    See also       VZoomWindow
  1105.  
  1106.    ---------------------------------------------------------------------------
  1107.    VScrollView procedure                                                  Wndw
  1108.    ---------------------------------------------------------------------------
  1109.    Function       Alters the upper left viewing reference point of the current 
  1110.                   virtual screen by a relative number of rows and columns.  
  1111.                   The view window is also updated no matter where its location 
  1112.                   even if hidden or overlapped.
  1113.    Declaration    VScrollView (NumOfRows,NumOfCols: integer)
  1114.    Remarks        The reference point may be adjusted to keep the viewing 
  1115.                   window within the virtual window limits.  Works in any 
  1116.                   "WriteTo" mode.
  1117.    Heap           If covered, WSrows * Wcols * 5 bytes is temporarily used.
  1118.    Restrictions   None.
  1119.    See also       VViewRC, VViewRCrel
  1120.  
  1121.    ---------------------------------------------------------------------------
  1122.    VUpdateCursor procedure                                                Wndw
  1123.    ---------------------------------------------------------------------------
  1124.    Function       Updates the current virtual window cursor if it is the top 
  1125.                   window on the CRT.
  1126.    Declaration    VUpdateCursor
  1127.    Remarks        When the cursor is moved on the virtual screen, the cursor 
  1128.                   may or may not be seen in the view.  This routine updates 
  1129.                   the location.  Works in any "WriteTo" mode.
  1130.    See also       VUpdateTitles, VUpdateView, VUpdateWindow
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.    Chapter 2, Procedures and Functions                                 Page 19
  1139.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1140.  
  1141.  
  1142.    ---------------------------------------------------------------------------
  1143.    VUpdateRows procedure                                                  Wndw
  1144.    ---------------------------------------------------------------------------
  1145.    Function       Updates certain rows in the current virtual window view only 
  1146.                   on the top window.
  1147.    Declaration    VUpdateRows (Row,Rows: byte)
  1148.    Remarks        This routine is primarily used for fast response for spot 
  1149.                   updates for data entry or the like where the fastest speed 
  1150.                   is desirable.  If the window is not the top window, the 
  1151.                   entire view is updated.
  1152.    See also       VUpdateView, VUpdateWindow
  1153.  
  1154.    ---------------------------------------------------------------------------
  1155.    VUpdateTitles procedure                                                Wndw
  1156.    ---------------------------------------------------------------------------
  1157.    Function       Updates the current virtual window titles.  It is also 
  1158.                   updated no matter where its location even if hidden or 
  1159.                   overlapped.
  1160.    Declaration    VUpdateTitles
  1161.    Remarks        This routine updates the titles to the window and truncates 
  1162.                   them to fit in the current view.  Works in any "WriteTo" 
  1163.                   mode.
  1164.    Heap           If covered, WSrows * Wcols * 5 bytes is temporarily used.
  1165.    See also       VUpdateCursor, VUpdateView, VUpdateWindow
  1166.  
  1167.    ---------------------------------------------------------------------------
  1168.    VUpdateView procedure                                                  Wndw
  1169.    ---------------------------------------------------------------------------
  1170.    Function       Updates the current virtual window view.  It is also updated 
  1171.                   no matter where its location even if hidden or overlapped.
  1172.    Declaration    VUpdateView
  1173.    Remarks        This routine updates the full view of the window.  Works in 
  1174.                   any "WriteTo" mode.
  1175.    Heap           If covered, WSrows * Wcols * 5 bytes is temporarily used.
  1176.    See also       VUpdateRows, VUpdateTitles, VUpdateWindow
  1177.  
  1178.    ---------------------------------------------------------------------------
  1179.    VUpdateWindow procedure                                                Wndw
  1180.    ---------------------------------------------------------------------------
  1181.    Function       Updates the current virtual window including the view, 
  1182.                   titles and the cursor.  It is also updated no matter where 
  1183.                   its location even if hidden or overlapped.
  1184.    Declaration    VUpdateWindow
  1185.    Remarks        This is the main routine to update virtual windows.  This 
  1186.                   routine simply executes three procedures: VUpdateCursor, 
  1187.                   VUpdateView, and VUpdateTitles.  Works in any "WriteTo" 
  1188.                   mode.  
  1189.    Restrictions   If transparent shadows appear over the window that is being 
  1190.                   updated, the shadows for the above window will not be 
  1191.                   updated.
  1192.    Heap           If covered, WSrows * Wcols * 5 bytes is temporarily used.
  1193.    See also       VUpdateCursor, VUpdateRows, VUpdateTitles, VUpdateView
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.    Chapter 2, Procedures and Functions                                 Page 20
  1200.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1201.  
  1202.  
  1203.    ---------------------------------------------------------------------------
  1204.    VViewRC procedure                                                      Wndw
  1205.    ---------------------------------------------------------------------------
  1206.    Function       Alters the upper left viewing reference point of the current 
  1207.                   virtual window.
  1208.    Declaration    VViewRC (Row,Col: byte)
  1209.    Remarks        The reference point may be adjusted to keep the viewing 
  1210.                   window within the virtual window limits.  Works in any 
  1211.                   "WriteTo" mode.  It does not update the viewing window.
  1212.    Restrictions   None.
  1213.    See also       VViewRCrel, VScrollView
  1214.  
  1215.    ---------------------------------------------------------------------------
  1216.    VViewRCrel procedure                                                   Wndw
  1217.    ---------------------------------------------------------------------------
  1218.    Function       Alters the upper left viewing reference point of the current 
  1219.                   virtual window by a relative number of rows and columns.
  1220.    Declaration    VViewRCrel (NumOfRows,NumOfCols: integer)
  1221.    Remarks        The reference point may be adjusted to keep the viewing 
  1222.                   window within the virtual window limits.  Works in any 
  1223.                   "WriteTo" mode.  It does not update the viewing window.
  1224.    Restrictions   None.
  1225.    See also       VViewRC, VScrollView
  1226.  
  1227.    ---------------------------------------------------------------------------
  1228.    VZoomWindow procedure                                                  Wndw
  1229.    ---------------------------------------------------------------------------
  1230.    Function       Toggles top virtual window between full screen size and 
  1231.                   original size.
  1232.    Declaration    VZoomWindow
  1233.    Remarks        If the window is less than full size, the window is zoomed 
  1234.                   to full size and centered if necessary.  Executing the 
  1235.                   procedure again will restore the size and location of this 
  1236.                   window.  If NoMoveMode or PermMode has been set for this 
  1237.                   window, the procedure is ignored.  Shadows are fully 
  1238.                   supported.  Margins are respected.
  1239.    Heap           Maximum requirement is full screen size plus the underlay 
  1240.                   size.
  1241.    Exit           Forced to write to CRT.
  1242.    See also       VResizeWindow
  1243.  
  1244.    ---------------------------------------------------------------------------
  1245.    WEosC function                                                         Wndw
  1246.    ---------------------------------------------------------------------------
  1247.    Function       Returns the window-relative column of the EOS marker.
  1248.    Declaration    WEosC
  1249.    Result type    byte
  1250.    Screens        All video pages and virtual screens.
  1251.    Remarks        Operates on the currently written screen.  The upper left 
  1252.                   corner of the window is (1,1). 
  1253.    See also       WEosR, WEosToRC, WEosLn, WGotoEos
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.    Chapter 2, Procedures and Functions                                 Page 21
  1261.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1262.  
  1263.  
  1264.    ---------------------------------------------------------------------------
  1265.    WEosLn procedure                                                       Wndw
  1266.    ---------------------------------------------------------------------------
  1267.    Function       Moves the EOS marker to column 1 of the next window-relative 
  1268.                   row with a possible scroll up.
  1269.    Declaration    WEosLn
  1270.    Screens        All video pages and virtual screens.
  1271.    Remarks        Operates on the currently written window.  If WEosR becomes 
  1272.                   greater than the number of window rows, then the window will 
  1273.                   scroll up.  The new blank row will have the attribute set by 
  1274.                   WndwAttr which is the window attribute.
  1275.    EOS            Updated to first cleared column of the cleared row.
  1276.    See also       WEosR, WEosC, WEosToRC, WGotoEos
  1277.  
  1278.    ---------------------------------------------------------------------------
  1279.    WEosToRC procedure                                                     Wndw
  1280.    ---------------------------------------------------------------------------
  1281.    Function       Positions the EOS marker relative to the current window.
  1282.    Declaration    WEosToRC (Row, Col: byte)
  1283.    Screens        All video pages and virtual screens.
  1284.    Remarks        Use this procedure to manually locate the EOS marker.  All 
  1285.                   EOS procedures will write where this marker is located on 
  1286.                   the currently written screen.
  1287.    EOS            Updated.
  1288.    Restrictions   Stay within the window limits.
  1289.    See also       QWIK, WEosR, WEosC, WEosLn, WGotoEos
  1290.    
  1291.    ---------------------------------------------------------------------------
  1292.    WEosR function                                                         Wndw
  1293.    ---------------------------------------------------------------------------
  1294.    Function       Returns the window-relative row of the EOS marker.
  1295.    Declaration    WEosR
  1296.    Result type    byte
  1297.    Screens        All video pages and virtual screens.
  1298.    Remarks        Operates on the currently written screen.  The upper left 
  1299.                   corner of the window is (1,1). 
  1300.    See also       WEosC, WEosToRC, WEosLn, WGotoEos
  1301.  
  1302.    ---------------------------------------------------------------------------
  1303.    WBrdrH procedure                                                       Wndw
  1304.    ---------------------------------------------------------------------------
  1305.    Function       Places a horizontal partition of the same type as the window 
  1306.                   border from edge to edge of the border.
  1307.    Declaration    WBrdrH (Row: byte)
  1308.    Screens        All video pages and virtual screens.
  1309.    Remarks        This routine divides a window using WSbrdr, BrdrAttr from 
  1310.                   the top window record.  It provides a horizontal line 
  1311.                   complete with a tee on each end using parts BrdrHL, BrdrLT, 
  1312.                   and BrdrRT.  If SameAttr is used for BrdrAttr, then the 
  1313.                   attributes will remain the same on the screen.  If there is 
  1314.                   no border, the procedure is ignored.
  1315.    EOS            Unaltered.
  1316.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  1317.    See also       WBrdrPart, WBrdrV, WLineH, WLinePart, WLineV
  1318.  
  1319.  
  1320.  
  1321.    Chapter 2, Procedures and Functions                                 Page 22
  1322.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1323.  
  1324.  
  1325.    ---------------------------------------------------------------------------
  1326.    WBrdrPart procedure                                                    Wndw
  1327.    ---------------------------------------------------------------------------
  1328.    Function       Places a single border part of the same type as the window 
  1329.                   border at a window-relative location.
  1330.    Declaration    WBrdrPart (Row,Col: byte; Part: BrdrParts)
  1331.    Screens        All video pages and virtual screens.
  1332.    Remarks        This routine places the part using WSbrdr, BrdrAttr from the 
  1333.                   top window record.  It is usually used for crosses or tees, 
  1334.                   but there are 15 different parts that can be used.  If 
  1335.                   SameAttr is used for BrdrAttr, then the attributes will 
  1336.                   remain the same on the screen.  If there is no border, the 
  1337.                   procedure is ignored.
  1338.    EOS            Unaltered.
  1339.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  1340.    See also       WBrdrH, WBrdrPart, WLineH, WLineV, WLinePart
  1341.  
  1342.    ---------------------------------------------------------------------------
  1343.    WBrdrV procedure                                                       Wndw
  1344.    ---------------------------------------------------------------------------
  1345.    Function       Places a vertical partition of the same type as the window 
  1346.                   border from edge to edge of the border.
  1347.    Declaration    WBrdrV (Row: byte)
  1348.    Screens        All video pages and virtual screens.
  1349.    Remarks        This routine divides a window using WSbrdr, BrdrAttr from 
  1350.                   the top window record.  It provides a vertical line complete 
  1351.                   with a tee on each end using parts BrdrVL, BrdrTT, and 
  1352.                   BrdrBT.  If SameAttr is used for BrdrAttr, then the 
  1353.                   attributes will remain the same on the screen.  If there is 
  1354.                   no border, the procedure is ignored.
  1355.    EOS            Unaltered.
  1356.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  1357.    See also       WBrdrH, WBrdrPart, WLineH, WLineV, WLinePart
  1358.  
  1359.    ---------------------------------------------------------------------------
  1360.    WClrEol procedure                                                      Wndw
  1361.    ---------------------------------------------------------------------------
  1362.    Function       Clears a row to End-Of-Line (EOL).
  1363.    Declaration    WClrEol (Row,Col: byte; Attr: integer)
  1364.    Screens        All video pages and virtual screens.
  1365.    Remarks        The row is cleared using the attribute Attr (SameAttr is 
  1366.                   permitted).  To force the window attribute, use 
  1367.                   TWS.WndwAttr.
  1368.    EOS            Set to (Row,Col).
  1369.    Restrictions   Stay within window limits.
  1370.    See also       WDelLine, WClrLine, WClrEos
  1371.  
  1372.    ---------------------------------------------------------------------------
  1373.    WClrEos procedure                                                      Wndw
  1374.    ---------------------------------------------------------------------------
  1375.    Function       Clears a row from EOS to End-Of-Line.
  1376.    Declaration    WClrEos (Attr: integer)
  1377.    Screens        All video pages and virtual screens.
  1378.    Remarks        The row is cleared starting at the EOS marker using the 
  1379.                   attribute Attr (SameAttr is permitted).  To force the window 
  1380.  
  1381.  
  1382.    Chapter 2, Procedures and Functions                                 Page 23
  1383.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1384.  
  1385.  
  1386.                   attribute, use TWS.WndwAttr.
  1387.    EOS            Unaltered.
  1388.    Restrictions   Stay within window limits.
  1389.    See also       WDelLine, WClrLine, WClrEos
  1390.  
  1391.    ---------------------------------------------------------------------------
  1392.    WClrField procedure                                                    Wndw
  1393.    ---------------------------------------------------------------------------
  1394.    Function       Clears a field.
  1395.    Declaration    WClrField (Row,Col,Cols: byte; Attr: integer)
  1396.    Screens        All video pages and virtual screens.
  1397.    Remarks        The field is cleared starting at (Row,Col) using the 
  1398.                   attribute Attr (SameAttr is permitted).  To force the window 
  1399.                   attribute, use TWS.WndwAttr.
  1400.    EOS            Set to (Row,Col).
  1401.    Restrictions   Stay within window limits.
  1402.    See also       WClrEol, WClrEos, WClrFieldEos
  1403.  
  1404.    ---------------------------------------------------------------------------
  1405.    WClrFieldEos procedure                                                 Wndw
  1406.    ---------------------------------------------------------------------------
  1407.    Function       Clears a field starting at EOS.
  1408.    Declaration    WClrFieldEos (Cols: byte; Attr: integer)
  1409.    Screens        All video pages and virtual screens.
  1410.    Remarks        The field is cleared starting at EOS using the attribute 
  1411.                   Attr (SameAttr is permitted).  To force the window 
  1412.                   attribute, use TWS.WndwAttr.
  1413.    EOS            Unaltered.
  1414.    Restrictions   Stay within window limits.
  1415.    See also       WClrEol, WClrEos, WClrField
  1416.  
  1417.    ---------------------------------------------------------------------------
  1418.    WClrLine procedure                                                     Wndw
  1419.    ---------------------------------------------------------------------------
  1420.    Function       Clears a specified row.
  1421.    Declaration    WClrLine (Row: byte)
  1422.    Screens        All video pages and virtual screens.
  1423.    Remarks        The row is cleared using the window attribute TWS.WndwAttr 
  1424.                   (SameAttr is permitted).
  1425.    EOS            Set to (Row,1).
  1426.    Restrictions   Stay within window limits.
  1427.    See also       WDelLine, WClrEol, WClrEos
  1428.  
  1429.    ---------------------------------------------------------------------------
  1430.    WClrScr procedure                                                      Wndw
  1431.    ---------------------------------------------------------------------------
  1432.    Function       Clears the entire window.
  1433.    Declaration    WClrScr
  1434.    Screens        All video pages and virtual screens.
  1435.    Remarks        Clears the screen using the window attribute TWS.WndwAttr 
  1436.                   (SameAttr is permitted).
  1437.    EOS            Set to (1,1).
  1438.    See also       WClrLine, WDelLine, WInsLine
  1439.  
  1440.  
  1441.  
  1442.  
  1443.    Chapter 2, Procedures and Functions                                 Page 24
  1444.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1445.  
  1446.  
  1447.    ---------------------------------------------------------------------------
  1448.    WClrTitle procedure                                                    Wndw
  1449.    ---------------------------------------------------------------------------
  1450.    Function       Clears the titles from the specified row.
  1451.    Declaration    WClrTitle (TopOrBottomRow: DirType);
  1452.    Screens        All video pages and virtual screens.
  1453.    Remarks        Clears the top or bottom border where the titles are located 
  1454.                   and restores the original border if any.  If WSbrdr=NoBrdr, 
  1455.                   the row is simply cleared.  Works on both fixed and virtual 
  1456.                   titles.
  1457.    EOS            Unaltered.
  1458.    See also       TitleWindow, VUpdateTitle
  1459.  
  1460.    ---------------------------------------------------------------------------
  1461.    WDelLine procedure                                                     Wndw
  1462.    ---------------------------------------------------------------------------
  1463.    Function       Deletes a line at a specified row, scrolls up the remaining 
  1464.                   part of the window and clears the bottom row.
  1465.    Declaration    WDelLine (Row: byte)
  1466.    Screens        All video pages and virtual screens.
  1467.    Remarks        Similar to Turbo's DelLine, the indicated row of the window 
  1468.                   will be deleted.  The bottom row is cleared with WndwAttr 
  1469.                   (SameAttr is permitted).  The cursor is not moved, but is 
  1470.                   ready to be moved with WGotoEos as EOS is set to the first 
  1471.                   column of the cleared row.
  1472.    EOS            Updated to first cleared column of the cleared row.
  1473.    Restrictions   Stay within window limits.
  1474.    See also       WInsLine, WScrollUp, WGotoEos
  1475.  
  1476.    ---------------------------------------------------------------------------
  1477.    WGotoEos procedure                                                     Wndw
  1478.    ---------------------------------------------------------------------------
  1479.    Function       Positions the cursor to match the EOS marker on both fixed 
  1480.                   or virtual windows.
  1481.    Declaration    WGotoEos
  1482.    Screens        All video pages and virtual screens.
  1483.    Remarks        The cursor is simply moved to match the position of the EOS 
  1484.                   marker of the currently written video page.  TWS.WSwhereR 
  1485.                   and TWS.WSwhereC are also updated.  For virtual windows, 
  1486.                   this routine also executes VUpdateCursor.
  1487.    EOS            Unaltered.
  1488.    See also       WEosR, WEosC, WEosToRC, WEosLn, WGotoRC, VUpdateCursor
  1489.    Restrictions   EOS should be within window limits.
  1490.    Example        Center a string in a window and place the cursor at the end 
  1491.                   of the string:
  1492.  
  1493.                     WWriteC (1,'Correct (Y/N)? ');
  1494.                     WGotoEos;
  1495.  
  1496.    ---------------------------------------------------------------------------
  1497.    WGotoRC procedure                                                      Wndw
  1498.    ---------------------------------------------------------------------------
  1499.    Function       Positions the cursor relative to the window.
  1500.    Declaration    WGotoRC (Row, Col: byte)
  1501.    Screens        All video pages and virtual screens.
  1502.  
  1503.  
  1504.    Chapter 2, Procedures and Functions                                 Page 25
  1505.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1506.  
  1507.  
  1508.    Remarks        The cursor is positioned to the currently written window.  
  1509.                   For virtual windows, this routine also executes 
  1510.                   VUpdateCursor.
  1511.    EOS            Unaltered.
  1512.    Restrictions   Stay within the window limits.
  1513.    See also       WGotoEos, WhereR, WhereC 
  1514.  
  1515.    ---------------------------------------------------------------------------
  1516.    WInsLine procedure                                                     Wndw
  1517.    ---------------------------------------------------------------------------
  1518.    Function       Inserts a blank line at a specified row using the window 
  1519.                   attribute WndwAttr scrolling down the remaining part.
  1520.    Declaration    WInsLine (Row: byte)
  1521.    Screens        All video pages and virtual screens.
  1522.    Remarks        Similar to Turbo's InsLine, the indicated row of the window 
  1523.                   is scrolled down and then cleared (SameAttr is permitted).  
  1524.                   The cursor is not moved, but is ready to be moved with 
  1525.                   WGotoEos as EOS is set to the first column of the cleared 
  1526.                   row.
  1527.    EOS            Updated to first cleared column of the cleared row.
  1528.    Restrictions   Stay within window limits.
  1529.    See also       WDelLine, WScrollDown, WGotoEos
  1530.  
  1531.    ---------------------------------------------------------------------------
  1532.    WLineH procedure                                                       Wndw
  1533.    ---------------------------------------------------------------------------
  1534.    Function       Places a horizontal line in the window using the window line 
  1535.                   set.
  1536.    Declaration    WLineH (Row,Col,Cols: byte)
  1537.    Screens        All video pages and virtual screens.
  1538.    Remarks        This routine divides a window using WSline, WndwAttr from 
  1539.                   the top window record.  It provides just a horizontal line 
  1540.                   using part BrdrHL.  If SameAttr is used for WndwAttr, then 
  1541.                   the attributes will remain the same on the screen.  If 
  1542.                   WSline=NoBrdr, then the procedure is ignored.
  1543.    EOS            Updated.
  1544.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  1545.    See also       WBrdrH, WBrdrPart, WBrdrV, WLinePart, WLineV
  1546.  
  1547.    ---------------------------------------------------------------------------
  1548.    WLinePart procedure                                                    Wndw
  1549.    ---------------------------------------------------------------------------
  1550.    Function       Places a single line part of the same type as the window 
  1551.                   line set at a window-relative location.
  1552.    Declaration    WLinePart (Row,Col: byte; Part: BrdrParts)
  1553.    Screens        All video pages and virtual screens.
  1554.    Remarks        This routine places the part using WSline, WndwAttr from the 
  1555.                   top window record.  It is usually used for crosses or tees, 
  1556.                   but there are 15 different parts that can be used.  If 
  1557.                   SameAttr is used for WndwAttr, then the attributes will 
  1558.                   remain the same on the screen.  If WSline=NoBrdr, the 
  1559.                   procedure is ignored.
  1560.    EOS            Updated.
  1561.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  1562.    See also       WBrdrH, WBrdrPart, WBrdrV, WLineH, WLineV
  1563.  
  1564.  
  1565.    Chapter 2, Procedures and Functions                                 Page 26
  1566.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1567.  
  1568.  
  1569.  
  1570.    ---------------------------------------------------------------------------
  1571.    WLineV procedure                                                       Wndw
  1572.    ---------------------------------------------------------------------------
  1573.    Function       Places a vertical line in the window using the window line 
  1574.                   set.
  1575.    Declaration    WLineV (Row,Col,Rows: byte)
  1576.    Screens        All video pages and virtual screens.
  1577.    Remarks        This routine divides a window using WSline, WndwAttr from 
  1578.                   the top window record.  It provides just a vertical line 
  1579.                   using part BrdrVL.  If SameAttr is used for WndwAttr, then 
  1580.                   the attributes will remain the same on the screen.  If 
  1581.                   WSline=NoBrdr, then the procedure is ignored.
  1582.    EOS            Updated.
  1583.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  1584.    See also       WBrdrH, WBrdrPart, WBrdrV, WLineH, WLinePart
  1585.  
  1586.    ---------------------------------------------------------------------------
  1587.    WriteAndViewPage procedure                                             Wndw
  1588.    ---------------------------------------------------------------------------
  1589.    Function       Changes the video page to be both viewed and written on the 
  1590.                   CRT.
  1591.    Declaration    WriteAndViewPage (PageNum: byte)
  1592.    Screens        All video pages.
  1593.    Remarks        If another video page is available, this routine will switch 
  1594.                   to both view and write to that page.  It does nothing if 
  1595.                   PageNum is already the currently written video page 
  1596.                   (QvideoPage) and viewed page (VideoPage), or if PageNum is 
  1597.                   invalid.  All WndwStats are swapped to exact same conditions 
  1598.                   as before.
  1599.    EOS            Restored to new page.
  1600.    See also       WriteToPage, Qwik.QviewPage, Qwik.QwritePage
  1601.  
  1602.    ---------------------------------------------------------------------------
  1603.    WriteToCRT procedure                                                  Wndw
  1604.    ---------------------------------------------------------------------------
  1605.    Function       Prepares QWIK and WNDW to write to the top window on the CRT 
  1606.                   and restores the Turbo window.
  1607.    Declaration    WriteToCRT
  1608.    Screens        Back to any video page.
  1609.    Remarks        This procedure switches back to writing to the top window on 
  1610.                   the CRT after writing to a hidden window or virtual screen.
  1611.    EOS            Restored to top window.
  1612.    See also       WriteToHidden, WriteToVirtual
  1613.  
  1614.    ---------------------------------------------------------------------------
  1615.    WriteToHidden procedure                                                Wndw
  1616.    ---------------------------------------------------------------------------
  1617.    Function       Prepares QWIK and WNDW to write to a hidden window.
  1618.    Declaration    WriteToHidden (WindowName: WindowNames)
  1619.    Remarks        This procedure switches to writing to a hidden window.  The 
  1620.                   window must be a valid window name, otherwise the program is 
  1621.                   terminated with an error message.
  1622.    EOS            Restored to hidden window.
  1623.    See also       WriteToCRT, WriteToVirtual
  1624.  
  1625.  
  1626.    Chapter 2, Procedures and Functions                                 Page 27
  1627.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1628.  
  1629.  
  1630.  
  1631.    ---------------------------------------------------------------------------
  1632.    WriteToPage procedure                                                 Wndw
  1633.    ---------------------------------------------------------------------------
  1634.    Function       Changes the video page on which the WNDW routines write with 
  1635.                   out changing the viewed page.
  1636.    Declaration    WriteToPage (PageNum: byte)
  1637.    Screens        All video pages.
  1638.    Remarks        If another video page is available, this routine will switch 
  1639.                   to write to that page.  It does nothing if PageNum is 
  1640.                   already the currently written video page (QvideoPage) or if 
  1641.                   the page is invalid.  All WndwStats are swapped to exact 
  1642.                   same conditions as before.
  1643.    EOS            Restored to new page.
  1644.    See also       WriteAndViewPage, Qwik.QwritePage
  1645.  
  1646.    ---------------------------------------------------------------------------
  1647.    WriteToVirtual procedure                                               Wndw
  1648.    ---------------------------------------------------------------------------
  1649.    Function       Prepares QWIK and WNDW to write to a virtual screen.
  1650.    Declaration    WriteToVirtual (WindowName: WindowNames)
  1651.    Remarks        This procedure switches to writing to a virtual screen.  The 
  1652.                   window must be a valid window name, otherwise, the program 
  1653.                   is terminated with an error message.
  1654.    EOS            Restored to virtual screen.
  1655.    See also       WriteToCRT, WriteToHidden
  1656.  
  1657.    ---------------------------------------------------------------------------
  1658.    WScrollDown procedure                                                  Wndw
  1659.    ---------------------------------------------------------------------------
  1660.    Function       Scrolls the current window down and clears the top row with 
  1661.                   the window attribute WndwAttr.
  1662.    Declaration    WScrollDown
  1663.    Screens        All video pages and virtual screens.
  1664.    Remarks        The last row of the window will be scrolled out and lost 
  1665.                   while the first row will be cleared (SameAttr is permitted).  
  1666.                   The cursor is not moved, but is ready to be moved with 
  1667.                   WGotoEos as EOS is set to the first column of the cleared 
  1668.                   row.
  1669.    EOS            Updated to first cleared column of the cleared row.
  1670.    Restrictions   None.
  1671.    See also       WScrollUp, WGotoEos
  1672.  
  1673.    ---------------------------------------------------------------------------
  1674.    WScrollUp procedure                                                    Wndw
  1675.    ---------------------------------------------------------------------------
  1676.    Function       Scrolls the current window up and clears the bottom row with 
  1677.                   the window attribute WndwAttr.
  1678.    Declaration    WScrollUp 
  1679.    Screens        All video pages and virtual screens.
  1680.    Remarks        The first row of the window will be scrolled out and lost 
  1681.                   while the last row will be cleared (SameAttr is permitted).  
  1682.                   The cursor is not moved, but is ready to be moved with 
  1683.                   WGotoEos as EOS is set to the first column of the cleared 
  1684.                   row.
  1685.  
  1686.  
  1687.    Chapter 2, Procedures and Functions                                 Page 28
  1688.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1689.  
  1690.  
  1691.    EOS            Updated to first cleared column of the cleared row.
  1692.    Restrictions   None.
  1693.    See also       WScrollDown, WGotoEos
  1694.  
  1695.    ---------------------------------------------------------------------------
  1696.    WWhereC function                                                       Wndw
  1697.    ---------------------------------------------------------------------------
  1698.    Function       Returns the window-relative column of the cursor on the 
  1699.                   currently written video page.
  1700.    Declaration    WWhereC
  1701.    Result type    byte
  1702.    Screens        All video pages only.
  1703.    Remarks        Operates on the currently written video page.  The upper 
  1704.                   left corner of the screen is (1,1). 
  1705.    See also       WGotoRC, WWhereR
  1706.  
  1707.    ---------------------------------------------------------------------------
  1708.    WWhereR function                                                       Wndw
  1709.    ---------------------------------------------------------------------------
  1710.    Function       Returns the window-relative row of the cursor on the 
  1711.                   currently written video page.
  1712.    Declaration    WWhereR
  1713.    Result type    byte
  1714.    Screens        All video pages only.
  1715.    Remarks        Operates on the currently written video page.  The upper 
  1716.                   left corner of the screen is (1,1). 
  1717.    See also       WGotoRC, WWhereC
  1718.  
  1719.    ---------------------------------------------------------------------------
  1720.    WWrite procedure                                                       Wndw
  1721.    ---------------------------------------------------------------------------
  1722.    Function       Writes a string relative to the current window using the 
  1723.                   window attribute.
  1724.    Declaration    WWrite (Row,Col: byte; aStr: string)
  1725.    Screens        All video pages and virtual screens.
  1726.    Remarks        This routine writes the string aStr at window-relative 
  1727.                   (Row,Col) with the attribute WndwAttr from the window 
  1728.                   record.  If SameAttr is used for WndwAttr, then the 
  1729.                   attributes will remain the same on the screen.
  1730.    EOS            Updated.
  1731.    Restrictions   Stay within the window limits.  Long strings will not wrap 
  1732.                   around to column 1.
  1733.    See also       WWriteA, WWriteC, WWriteSub
  1734.    Example        Write the string "Enter" at (2,1) with the current window 
  1735.                   attribute:
  1736.  
  1737.                     WWrite (2,1,'Enter');
  1738.  
  1739.    Example        Write the string "Answer" at (2,1) with the attribute of 
  1740.                   flashing white on red and then restore the current window 
  1741.                   attribute:
  1742.  
  1743.                     with TopWndwStat do
  1744.                       begin
  1745.                         WndwAttr := Blink+White+RedBG;
  1746.  
  1747.  
  1748.    Chapter 2, Procedures and Functions                                 Page 29
  1749.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1750.  
  1751.  
  1752.                         Wwrite (2,1,'Answer');
  1753.                         WndwAttr := OrigAttr;
  1754.                       end;
  1755.  
  1756.    ---------------------------------------------------------------------------
  1757.    WWriteA procedure                                                      Wndw
  1758.    ---------------------------------------------------------------------------
  1759.    Function       Writes a string relative to the current window overriding 
  1760.                   the current window attribute.
  1761.    Declaration    WWriteA (Row,Col: byte; Attr: integer; aStr: string)
  1762.    Screens        All video pages and virtual screens.
  1763.    Remarks        This routine writes the string aStr at window-relative 
  1764.                   (Row,Col) with the specified attribute.  If SameAttr is used 
  1765.                   for Attr, then the attributes will remain the same on the 
  1766.                   screen.
  1767.    EOS            Updated.
  1768.    Restrictions   Stay within the window limits.  Long strings will not wrap 
  1769.                   around to column 1.
  1770.    See also       WWrite, WWriteC, WWriteSub
  1771.    Example        Write the string "Enter" at (2,1) with Yellow on Blue 
  1772.                   attribute:
  1773.  
  1774.                     WWriteA (2,1,Yellow+BlueBG,'Enter');
  1775.  
  1776.    ---------------------------------------------------------------------------
  1777.    WWriteAC procedure                                                     Wndw
  1778.    ---------------------------------------------------------------------------
  1779.    Function       Writes a string centered column-wise to the current window 
  1780.                   overriding the current window attribute.
  1781.    Declaration    WWriteAC (Row: byte; Attr: integer; aStr: string)
  1782.    Screens        All video pages and virtual screens.
  1783.    Remarks        This routine writes the string aStr centered between the 
  1784.                   left and right columns of the window.  If SameAttr is used 
  1785.                   for Attr, then the attributes will remain the same on the 
  1786.                   screen.
  1787.    EOS            Updated.
  1788.    Restrictions   Stay within the window limits.  Long strings will not wrap 
  1789.                   around to column 1.
  1790.    See also       WWrite, WWriteA, WWriteC, WWriteSub
  1791.    Example        Write a message centered in a window on row 5 with a Black 
  1792.                   on LightGray attribute:
  1793.  
  1794.                     WWriteAC (5,LightGrayBG,'My message'); 
  1795.  
  1796.    ---------------------------------------------------------------------------
  1797.    WWriteC procedure                                                      Wndw
  1798.    ---------------------------------------------------------------------------
  1799.    Function       Writes a string centered column-wise to the current window 
  1800.                   using the window attribute.
  1801.    Declaration    WWriteC (Row: byte; aStr: string)
  1802.    Screens        All video pages and virtual screens.
  1803.    Remarks        This routine writes the string aStr centered between the 
  1804.                   left and right columns of the window.  The attribute used is 
  1805.                   WndwAttr from the window record.  If SameAttr is used for 
  1806.                   WndwAttr, then the attributes will remain the same on the 
  1807.  
  1808.  
  1809.    Chapter 2, Procedures and Functions                                 Page 30
  1810.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1811.  
  1812.  
  1813.                   screen.
  1814.    EOS            Updated.
  1815.    Restrictions   Stay within the window limits.  Long strings will not wrap 
  1816.                   around to column 1.
  1817.    See also       WWrite, WWriteSub
  1818.    Example        Write a message centered in a window on row 5:
  1819.  
  1820.                     WWriteC (5,'My message'); 
  1821.  
  1822.    ---------------------------------------------------------------------------
  1823.    WWriteSub procedure                                                    Wndw
  1824.    ---------------------------------------------------------------------------
  1825.    Function       Writes an array (or substring) with a specified length relative 
  1826.                   to the current window using the window attribute.
  1827.    Declaration    WWriteSub (Row,Col: byte; SubStringLen: word; VAR aStr)
  1828.    Screens        All video pages and virtual screens.
  1829.    Remarks        This routine writes the array aStr at window-relative 
  1830.                   (Row,Col) for the number of columns specified by 
  1831.                   SubStringLen.  This enables you to write substrings when 
  1832.                   specifying a starting index (aStr[i]).  (Other routines like 
  1833.                   WWrite assume the length is the value at aStr[0] and the 
  1834.                   starting index is aStr[1].)  Of course, aStr doesn't have to 
  1835.                   be a string - it can be any type variable or address in 
  1836.                   memory.  The attribute used is WndwAttr from the window 
  1837.                   record.  If SameAttr is used for WndwAttr, then the 
  1838.                   attributes will remain the same on the screen.
  1839.    EOS            Updated.
  1840.    Restrictions   Stay within the window limits.  Long strings will not wrap 
  1841.                   around to column 1.
  1842.    See also       WWrite, WWriteC
  1843.    Example        The following will write "Testing out this line."  with the 
  1844.                   current window attribute:
  1845.  
  1846.                      MyString := 'Step B: Testing out this line.';
  1847.                      WWriteSub (1,1,22,MyString[9]);
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.    Chapter 2, Procedures and Functions                                 Page 31
  1871.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1872.  
  1873.  
  1874.    3.  D A T A   S T R U C T U R E
  1875.  
  1876.    This section will help describe the data structure of WNDW and how it can 
  1877.    be adjusted.  The variables in W70-VAR.INC are allocated according to the 
  1878.    conditional directives and constants set at the beginning of the file.  
  1879.    There are several basic variables, but if desired, there are additional 
  1880.    variables for virtual windows and multiple video pages.  Please refer to 
  1881.    the source code in W70-VAR.INC for the exact listing.
  1882.  
  1883.  
  1884.    BASIC TYPES
  1885.  
  1886.    Basic Types - These types are used for all windows and modes to define the 
  1887.    data structure.  This will describe the purpose of each type.
  1888.  
  1889.      Type          Description
  1890.      ------------  -----------------------------------------------------------
  1891.      Borders       This enumerated type gives a name for 15 different border 
  1892.                    styles each having 15 different parts already assigned in 
  1893.                    the constant array Brdr.  The name NoBrdr is reserved.
  1894.  
  1895.                      NoBrdr         - No border at all.  Just the text area.
  1896.                      BlankBrdr      - Blank character on all sides.
  1897.                      SingleBrdr     - Single lines on all sides.
  1898.                      DoubleBrdr     - Double lines on all sides.
  1899.                      HdoubleBrdr    - Horizontal double lines.  Single 
  1900.                                       vertical lines.
  1901.                      VdoubleBrdr    - Vertical double lines.  Single 
  1902.                                       horizontal lines.
  1903.                      SolidBrdr      - Solid box character on all sides.
  1904.                      EvenSolidBrdr  - Vertical solid box.  Horizontal half 
  1905.                                       box.
  1906.                      ThinSolidBrdr1 - Half box on all sides.  Squeezed 
  1907.                                       horizontally.
  1908.                      ThinSolidBrdr2 - Half box on all sides.  Squeezed 
  1909.                                       vertically.
  1910.                      LhatchBrdr     - Light hatch character on all sides.
  1911.                      MhatchBrdr     - Medium hatch character on all sides.
  1912.                      HhatchBrdr     - Heavy hatch character on all sides.
  1913.                      UserBrdr1      - User defined border.
  1914.                      UserBrdr2      - User defined border.
  1915.  
  1916.      BrdrParts     Each border has 15 different parts.  This enumerated type 
  1917.                    identifies each part by name.  Using acronyms, the relative 
  1918.                    position can be easily identified.  For example, BrdrTL 
  1919.                    means the Top Left border part.  The order corresponds with 
  1920.                    the BrdrRec type:
  1921.  
  1922.                      Relative Position      The first letter means:
  1923.                      ------------------        T = Top         B = Bottom
  1924.                      TL  TH  TT  TH  TR        V = Vertical    H = Horizontal
  1925.                      LV      VL      RV        L = Left        R = Right
  1926.                      LT  HL  CL  HL  RT        C = Cross
  1927.                      LV      VL      RV     Second letter exceptions:
  1928.                      BL  BH  BT  BH  BR        T = Tee         L = Line
  1929.  
  1930.  
  1931.    Chapter 3, Data Structure                                           Page 32
  1932.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1933.  
  1934.  
  1935.  
  1936.      BrdrRec       This type provides the structure for each border style to 
  1937.                    access all 15 different parts.  By having a tag field, two 
  1938.                    different methods can be used to address the parts.
  1939.  
  1940.      DirType       This enumerated type identifies various directions.  They 
  1941.                    can be extended.
  1942.  
  1943.      MarginRec     Groups the margins used for moving or resizing windows.
  1944.  
  1945.      WindowNames   This enumerated type gives a name or handle for each window 
  1946.                    to uniquely identify a window record for random access.  
  1947.                    Any additional name can be used, but three are reserved: 
  1948.  
  1949.                      Name       Description
  1950.                      ---------- ---------------------------------------------
  1951.                      Window0    Identifies the initial base screen and must be 
  1952.                                 first in the list.
  1953.                      FreeWindow Identifies virtual screen records that are 
  1954.                                 free to be overwritten.
  1955.                      aWindow    A generic name to be used when the window does 
  1956.                                 not need to be unique.  It is usually used for 
  1957.                                 temporary windows like error messages.
  1958.  
  1959.  
  1960.      WndwStatType  This type sets up the basic structure to a window record.  
  1961.                    Each field in record is worth describing.  The WS prefix is 
  1962.                    an acronym meaning WndwStat.  There is 50 bytes per record.
  1963.  
  1964.                      WSrow .. WScol2 - These variables identify the location 
  1965.                      and size of the window INCLUDING the border if any.  The 
  1966.                      "2" suffix means the right column or bottom row location.
  1967.  
  1968.                      Wrow .. Wcol2 - These variables identify the location 
  1969.                      and size of the window EXCLUDING the border if any.  The 
  1970.                      "2" suffix means the right column or bottom row location.
  1971.  
  1972.                      WndwAttr/BrdrAttr/OrigAttr - These the attributes for the 
  1973.                      window and border respectively.  The value can even be 
  1974.                      SameAttr.  OrigAttr is a second copy of WndwAttr used to 
  1975.                      restore WndwAttr to its original value.
  1976.  
  1977.                      WSbrdr/WSline - The former is the current border style 
  1978.                      while the latter is a line set that can be used within 
  1979.                      the window.  When a window is made, these two values are 
  1980.                      the same, but WSline is available to be changed to the 
  1981.                      needed line set.
  1982.  
  1983.                      WSname - The unique name assigned to the window record.
  1984.  
  1985.                      WSwhereR/WSwhereC - These variables save the window-
  1986.                      relative row and column of the cursor.
  1987.  
  1988.                      WSmodes - Saves all the modes that created the window 
  1989.                      including the current status.
  1990.  
  1991.  
  1992.    Chapter 3, Data Structure                                           Page 33
  1993.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  1994.  
  1995.  
  1996.  
  1997.                      WScursor - Save the cursor mode used with this window.
  1998.  
  1999.                      ULcol .. ULbytes - Saves the location and size of the 
  2000.                      underlay of a window including the border and shadow if 
  2001.                      any.
  2002.  
  2003.                      ULptr - Points to the saved underlay in the heap.
  2004.  
  2005.                      VScrRec - Holds the QWIK screen data for this window.
  2006.  
  2007.                      RefRow/RefCol - These two scratch coordinates are used 
  2008.                      for two cases.  It saves the absolute row/col where a 
  2009.                      window is positioned before it is hidden.  For virtual 
  2010.                      screen stats, it saves the view reference point.
  2011.  
  2012.                      ViewBrdr - Saves the border style originally created with 
  2013.                      the window.  WSbrdr differs from ViewBrdr in that WSbrdr 
  2014.                      contains the current border.  For virtual screens, WSbrdr 
  2015.                      is always NoBrdr even though the view on the CRT may be a 
  2016.                      different style.
  2017.  
  2018.                      VI - Virtual screen index for its associated virtual 
  2019.                      window stat if any.
  2020.  
  2021.      WndwStatsType  Sets up the total number of WndwStat records for the 
  2022.                    program which defined by the constant MaxWndw.
  2023.  
  2024.      VirtualStatsType  Sets up the total number of VirtualStat records for the 
  2025.                    program which defined by the constant MaxVirtualWndw.
  2026.  
  2027.      WordArray     Used to identify each Character/Attribute combination from 
  2028.                    a screen.  The range of the array is irrelevant.
  2029.  
  2030.      WordArrayPtrType  A pointer of WordArray.
  2031.  
  2032.  
  2033.    TYPED CONSTANTS
  2034.  
  2035.    Typed Constants - These constants set defaults used to create window 
  2036.    borders, shadows and titles.
  2037.  
  2038.      Constant      Description
  2039.      ------------  -----------------------------------------------------------
  2040.      Brdr          Contains 14 different border styles each with 15 border 
  2041.                    parts.  The flexible data structure enables you to get 
  2042.                    parts with either of two methods - by field identifier or 
  2043.                    by index name.  For example, it is easiest to use the field 
  2044.                    identifier: 
  2045.  
  2046.                      MyPart := Brdr[SingleBrdr].TL
  2047.  
  2048.                    Since field identifiers can't be passed as parameters, the 
  2049.                    index names must be used.  To get the same result if the 
  2050.                    name BrdrTL is passed as a value:
  2051.  
  2052.  
  2053.    Chapter 3, Data Structure                                           Page 34
  2054.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  2055.  
  2056.  
  2057.  
  2058.                      MyPart := Brdr[SingleBrdr].BrdrArray[BrdrTL]
  2059.  
  2060.                    Both methods use the same code; the former is simply easier 
  2061.                    to write.
  2062.  
  2063.      PreferMultiTask  This boolean defaults to false so that would ignore any 
  2064.                    multi-tasking environment.  When set to true just before 
  2065.                    InitWindow, WNDW will then use the higher speed video 
  2066.                    buffer (MTVB) if available.
  2067.  
  2068.      ShadowChar    This is the character used to produce a shadow which is 
  2069.                    set equal to a space.  This may not be desirable for 
  2070.                    monochrome monitors which may look better with hatch 
  2071.                    characters.
  2072.  
  2073.      ShadowColor   This is the attribute used to produce a shadow which is set 
  2074.                    to Black on Black.  Any attribute can be used.
  2075.  
  2076.      TitleOfs      When writing titles, this offset is used to adjust where 
  2077.                    the title starts writing.  Left justified titles start 
  2078.                    at Wcol+TitleOfs while the Right end at Wcol2-TitleOfs.  
  2079.                    Center justified titles are not affected.  The default is 
  2080.                    1.  
  2081.  
  2082.  
  2083.    UNTYPED CONSTANTS
  2084.  
  2085.    Untyped Constants - These constants are used to control the data structure 
  2086.    size or to conveniently set window mode bits.
  2087.  
  2088.      Constant        Value  Description
  2089.      --------------  -----  --------------------------------------------------
  2090.      MaxWndw         1-254  Set by the user, this value determines the maximum 
  2091.                             number of windows that can be on the CRT on any 
  2092.                             video page.  This sets the amount of global data 
  2093.                             to be used.
  2094.  
  2095.      MaxVirtualWndw  0-254  Set by the user, this value determines the total
  2096.                             number of virtual screens minus one that will be 
  2097.                             maintained at any one time.  If no virtual windows 
  2098.                             are wanted, undefine the directive AddVirtual.
  2099.  
  2100.      MaxPageUsed     0 - 7  Set by the user, this value determines the highest 
  2101.                             page number to be managed in a multi-page program.  
  2102.                             If only page 0 is going to be used (which is 
  2103.                             usually the case), then undefine the directive 
  2104.                             MultiPage.  This will reduce the global data by a 
  2105.                             significant amount.
  2106.  
  2107.    Window Modes - There are several window modes and combination of modes that 
  2108.    can be set using SetWindowModes and saved in the variable WindowModes.  
  2109.    This is a list of those modes, values and descriptions.  After the window 
  2110.    is created, the modes are saved in WSmodes as well as the "To*" modes which 
  2111.    indicates the status of the window.
  2112.  
  2113.  
  2114.    Chapter 3, Data Structure                                           Page 35
  2115.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  2116.  
  2117.  
  2118.  
  2119.      Constant        Value  Description
  2120.      --------------  -----  --------------------------------------------------
  2121.      RelMode         $0001  (Bit 0) Simply overwrites the screen relative to 
  2122.                             the current window.  The Row/Col coordinate is 
  2123.                             window relative.  Works and stays in the current 
  2124.                             WriteTo mode.  This is usually used for flexible 
  2125.                             screen design.  The stats are only temporary and 
  2126.                             lost after changing windows.  To get back to the 
  2127.                             parent window, use RemoveWindow.
  2128.      PermMode        $0002  (Bit 1) Makes the window permanent on the screen - 
  2129.                             no underlay is saved.  These windows must be the 
  2130.                             first ones created.  They can be accessed, but be 
  2131.                             sure no other window is covering it (WI<=PLI) 
  2132.                             because they are not necessarily the top window.
  2133.                             before writing to the screen.
  2134.      ShadowLeft      $0004  (Bit 2) Places a shadow on the left side.
  2135.      ShadowRight     $0008  (Bit 3) Places a shadow on the right side.
  2136.      ShadowTrans     $0010  (Bit 4) Creates transparent shadows.
  2137.      ZoomMode        $0020  (Bit 45 Creates a zoom effect with MakeWindow, 
  2138.                             ShowWindow, and AccessWindow.
  2139.      HiddenMode      $0040  (Bit 6) Creates the window as hidden.
  2140.      VirtualMode     $0080  (Bit 7) Creates a virtual window with a virtual 
  2141.                             screen.
  2142.      CursorOffMode   $0100  (Bit 8) Always leaves cursor off.
  2143.      SeeThruMode     $0200  (Bit 9) Doesn't clear screen inside the border and 
  2144.                             ignores ZoomMode.
  2145.      NoHideMode      $0400  (Bit 10) Ignores request to hide window.
  2146.      NoAccessMode    $0800  (Bit 11) Ignores request to access window.
  2147.      NoMoveMode      $1000  (Bit 12) Ignores request to move/resize window.
  2148.      ToCRTmode       $2000  (Bit 13) Indicates writing to CRT.
  2149.      ToHiddenMode    $4000  (Bit 14) Indicates writing to hidden window.
  2150.      ToVirtualMode   $8000  (Bit 15) Indicates writing to virtual screen.
  2151.  
  2152.  
  2153.    GLOBAL VARIABLES
  2154.  
  2155.    Global Variables - Finally, the variables used in WNDW can be described in 
  2156.    detail and can be accessed by the user.
  2157.  
  2158.    Window Flags - While writing to a window, it is difficult to try to analyze 
  2159.    the bits in WSmodes to figure out its modes.  So, each mode has been given 
  2160.    a corresponding boolean flag.  These flags are set for the current window.  
  2161.    Though rather intuitive, the flag variables is listed below with its 
  2162.    corresponding mode:
  2163.  
  2164.      Flag            Mode
  2165.      --------------  --------------
  2166.      RelFlag         RelMode
  2167.      PermFlag        PermMode
  2168.      ZoomFlag        ZoomMode
  2169.      HiddenFlag      HiddenMode
  2170.      VirtualFlag     VirtualMode
  2171.      CursorOffFlag   CursorOffMode
  2172.      SeeThruFlag     SeeThruMode
  2173.  
  2174.  
  2175.    Chapter 3, Data Structure                                           Page 36
  2176.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  2177.  
  2178.  
  2179.      NoHideFlag      NoHideMode
  2180.      NoAccessFlag    NoAccessMode
  2181.      NoMoveFlag      NoMoveMode
  2182.      ToCRTflag       ToCRTmode
  2183.      ToHiddenFlag    ToHiddenMode
  2184.      ToVirtualFlag   ToVirtualMode
  2185.  
  2186.    Single Page Variables - The following variables are grouped together 
  2187.    because they are specific to the current video page being used.  If you do 
  2188.    use more than one page, these variables will be swapped with another page.
  2189.  
  2190.      Variable        Description
  2191.      --------------  ---------------------------------------------------------
  2192.      WndwStat        (Type: WndwStatsType)  This is the array for the maximum 
  2193.                      number of windows both hidden and shown at one time.  
  2194.                      Each record only uses 52 bytes of global data.  
  2195.                      WndwStat[0] is always the record for the initial window.
  2196.  
  2197.      TopWndwStat     (Type: WndwStatsType)  This record makes it easy to 
  2198.                      always access the data for the current window and is 
  2199.                      always up-to-date.  This data will be saved in the 
  2200.                      correct WndwStat before accessing another window.
  2201.  
  2202.      TWS             (Type: WndwStatsType)  This is the same as TopWndwStat, 
  2203.                      but just easier to write.
  2204.  
  2205.      TopVirtualStat  (Type: WndwStatsType)  For virtual windows, in addition 
  2206.                      to TWS, there is the TopVirtualStat for the associated 
  2207.                      virtual screen which has its own record.
  2208.  
  2209.      TVS             (Type: WndwStatsType)  This is the same as 
  2210.                      TopVirtualStat, but just easier to write.  Keep in mind 
  2211.                      that when writing direct to the virtual screen 
  2212.                      (WriteToVirtual), TWS and TVS are reversed.  It would 
  2213.                      then be helpful to think of TVS as the top VIEW stat, 
  2214.                      since the view is on the CRT.
  2215.  
  2216.      LI              (Type: Word)  This is the top Level Index for the top 
  2217.                      window currently shown on the CRT.  Windows shown on the 
  2218.                      CRT are sequentially stacked from index 0 upward.
  2219.  
  2220.      HLI             (Type: Word)  This is the Hidden Level Index which are 
  2221.                      stacked from index equal to MaxWndw downward.  If there 
  2222.                      are no hidden windows, HLI=MaxWndw+1.
  2223.  
  2224.      WI              (Type: Word)  For the current Window Index, the program 
  2225.                      saves and retrieves the WndwStat from this index whether 
  2226.                      it is hidden or shown.  It ranges from 0 to MaxWndw.  For 
  2227.                      hidden windows, can range from HLI to MaxWndw.  For the 
  2228.                      top window on the CRT, WI=LI.  For PermMode windows, it 
  2229.                      can be <=LI.
  2230.  
  2231.      PLI             (Type: Byte)  This Permanent Level Index keeps track of 
  2232.                      the order of the permanent windows on the CRT.  They must 
  2233.                      be stacked contiguously as the first ones on the CRT or 
  2234.  
  2235.  
  2236.    Chapter 3, Data Structure                                           Page 37
  2237.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  2238.  
  2239.  
  2240.                      else an error message will be displayed.  This value is 
  2241.                      <=LI.
  2242.  
  2243.      CursorDefault   (Type: word)  This is the value saved from 
  2244.                      SetCursorDefault for the cursor mode which can be just as 
  2245.                      easily set directly.  When MakeWindow is used, this is 
  2246.                      the value saved for that window.
  2247.  
  2248.      Margins         (Type: MarginRec)  These margins limit the moving or 
  2249.                      resizing of windows for each video page.  This prevents 
  2250.                      windows from covering status lines or the like.
  2251.  
  2252.      WindowModes     (Type: word)  This is the value saved from 
  2253.                      SetWindowModes.  It is best to use the procedure for this 
  2254.                      value since it filters out incompatible modes.
  2255.  
  2256.      TopPageStat    (Type: PageStatRec)  Rather than being redundant, the 
  2257.                      above ten variables for a single page are all contained 
  2258.                      in this record.  This makes it easy to swap data with 
  2259.                      other page.  This is the data currently being used on the 
  2260.                      screen.
  2261.  
  2262.    Universal Variables - These variables are not specific to any window or 
  2263.    video page and are used universally in the program.
  2264.  
  2265.      Variable        Description
  2266.      --------------  ---------------------------------------------------------
  2267.      VirtualRows     (Type: byte)  This is the row height saved from 
  2268.                      SetVirtualSize setting the number of rows used in the 
  2269.                      virtual screen.  The default is CRTrows.
  2270.  
  2271.      VirtualCols     (Type: byte)  This is the column width saved from 
  2272.                      SetVirtualSize setting the number of columns used in the 
  2273.                      virtual screen.  The default is CRTcols.
  2274.  
  2275.      VirtualSize     (Type: word)  This is the size in bytes to be reserved 
  2276.                      for the virtual screen.  The size is VirtualCols * 
  2277.                      (VirtualRows+2) * 2.  Remember the last two rows are 
  2278.                      added for the virtual titles.
  2279.  
  2280.      MaxValidPage    (Type: byte)  The program can reserve enough data for all 
  2281.                      video pages being address with MaxPageUsed.  However, the 
  2282.                      machine that runs the program must have those pages 
  2283.                      available.  This variable additionally limits the pages 
  2284.                      that can be addressed which is the lesser of MaxPage or 
  2285.                      MaxPageUsed.
  2286.  
  2287.      ZoomDelay       (Type: byte)  This value is set by InitWindow to control 
  2288.                      the zoom rate on non-snowing video cards.  This value is 
  2289.                      set according to the CpuID.
  2290.  
  2291.      CrtWI           (Type: word)  This value saves the last index that is 
  2292.                      being used to indicate which window is active on the CRT.  
  2293.                      The value is always CrtWI<=LI and is primarily used to 
  2294.                      indicate which window has the cursor.
  2295.  
  2296.  
  2297.    Chapter 3, Data Structure                                           Page 38
  2298.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  2299.  
  2300.  
  2301.  
  2302.  
  2303.    DYNAMIC VARIABLES
  2304.  
  2305.    Dynamic Variables - These variables are allocated to the heap to leave more 
  2306.    room for global variables.  They are allocated in InitWindow.
  2307.  
  2308.      Pointer         Description
  2309.      --------------  ---------------------------------------------------------
  2310.      VirtualStat     (Type: ^WndwStatType)  This array of window records is 
  2311.                      for the virtual screens associated with the virtual 
  2312.                      windows.  All routines use this data when writing to 
  2313.                      virtual screens by copying it to TWS.  The index for this 
  2314.                      record is obtain from TWS.VI.  Since this array is filled 
  2315.                      at random, VI does not correspond to WI.  When a virtual 
  2316.                      window is removed, these stats are "freed" by renaming 
  2317.                      WSname to FreeWindow - they are not freed by FreeMem.  
  2318.                      All video pages use this one array.
  2319.  
  2320.      PageStat        (Type: ^PageStatRec)  If your program uses multiple video 
  2321.                      pages, a complete record of all the window records and 
  2322.                      indexes are saved for each video page.  These can be 
  2323.                      easily swapped with TopPageStat to work on the current 
  2324.                      video page.  The WriteToPage procedure handles this 
  2325.                      operation.
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.    Chapter 3, Data Structure                                           Page 39
  2359.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  2360.  
  2361.  
  2362.    A P P E N D I X  A :   M E M O R Y   A L L O C A T I O N
  2363.  
  2364.    This section covers the memory requirements for global data in the data 
  2365.    segment and dynamic data in the heap.  This will give you the figures on 
  2366.    how to calculate the memory needed for your program.
  2367.  
  2368.  
  2369.    GLOBAL MEMORY
  2370.  
  2371.    Global Memory - WNDW is very frugal with global data.  Here is the 
  2372.    breakdown on the fixed amount of data required:
  2373.  
  2374.      Variables                       Bytes
  2375.      ------------------------------- -----
  2376.      Border array constants            210
  2377.      Basic windows                     146
  2378.      Additional for virtual windows     69
  2379.      Additional for multi-page video     4
  2380.                                      -----
  2381.      Fixed allocation                  429
  2382.  
  2383.    The additional for virtual windows and multi-page video can be deleted with 
  2384.    directives if not used.  This is the allocation for MaxWndw=0.  For each 
  2385.    additional window record, add 52 bytes.  So, for MaxWndw=10, the allocation 
  2386.    would be (52*10)+429=949 bytes.
  2387.  
  2388.  
  2389.    DYNAMIC MEMORY
  2390.  
  2391.    Dynamic Variables - To alleviate using global data, dynamic variables are 
  2392.    used for permanent and temporary use.  The allocation for virtual screen 
  2393.    records and video page records are permanent throughout the program.  Many 
  2394.    other procedures such as MoveWindow temporarily use the heap to perform 
  2395.    operations.
  2396.  
  2397.    Permanent Variables - If the directives have been defined, the following 
  2398.    allocation can be calculated:
  2399.  
  2400.      Variables       Bytes
  2401.      --------------- -------------------------------
  2402.      VirtualStat     52 per virtual window
  2403.      PageStat        (SizeOf(TopPageStat)) per video page
  2404.      Virtual screen  VirtualSize
  2405.  
  2406.    Virtual screens are kept in memory until RemoveWindow is used.
  2407.  
  2408.    Temporary Variables - For procedures that temporarily use the heap, the 
  2409.    size of allocation is listed along with each procedure in section 2 above.  
  2410.    Generally, you should allow about the same size as 3 CRT screens of 
  2411.    available Heap for those procedures.  For a video mode with 25 rows and 80 
  2412.    columns, this is (80*25*2)*3=12000 bytes.  This should be added in addition 
  2413.    to the random allocation.
  2414.  
  2415.    Random Allocation - Because of the nature of random access to windows and 
  2416.    underlays, the program uses GetMem and FreeMem.  This means that there are 
  2417.  
  2418.  
  2419.    Appendix A: Memory Allocation                                       Page 40
  2420.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  2421.  
  2422.  
  2423.    going to be gaps of free memory in the heap.  To account for this, you 
  2424.    should more than double the amount of data expected for underlays and 
  2425.    virtual screens.  It is up to you to judge just how must of the heap is 
  2426.    going to be truly random.  In the case of simple serial-access to windows, 
  2427.    the heap will be contiguous and doubling of the heap is unnecessary.
  2428.  
  2429.  
  2430.    CODE SIZE
  2431.  
  2432.    Code Size - WNDW is also very frugal with with code.  Here is the 
  2433.    breakdown for code usage (this may vary slightly):
  2434.  
  2435.      Code Description                Bytes
  2436.      ------------------------------- -----
  2437.      Basic windows                    8632
  2438.      Additional for virtual windows   3957
  2439.      Additional for multi-page video   265
  2440.      Additional code for shadows       893
  2441.                                      -----
  2442.      Total code                      13747
  2443.  
  2444.    Of course the smart compiler will optimize the code leaving out unused 
  2445.    procedures.  But this gives you a good idea of how small the code really 
  2446.    is!  If you do not need the additional code, use the compiler directives in 
  2447.    the WNDW70A.PAS unit to eliminate it.
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.    Appendix A: Memory Allocation                                       Page 41
  2481.    WNDW Multi-level Virtual Windows              Reference Guide, Version 7.0a
  2482.  
  2483.  
  2484.    A P P E N D I X  B :   E R R O R   M E S S A G E S
  2485.  
  2486.    Because WNDW is so powerful, it writes to screen in memory as well as the 
  2487.    CRT.  Should you make a mistake in programming, it may not show up on the 
  2488.    CRT screen.  So, to prevent the errors before they happen, programs written 
  2489.    with errors will terminate with an error message window on the CRT to 
  2490.    reveal the problem.  The program terminates through the GOOF unit which can 
  2491.    be freely edited.
  2492.  
  2493.    "Not enough heap space" - The minimum heap size is too small.  Increase the 
  2494.    size as required in APPENDIX A.
  2495.  
  2496.    "Too many windows" - Tried to create more windows than MaxWndw allows.  
  2497.    Either remove windows or increase MaxWndw.
  2498.  
  2499.    "Too many virtual windows" - Tried to create more virtual windows than 
  2500.    MaxVirtualWndw allows.  Either remove windows or increase MaxVirtualWndw.
  2501.  
  2502.    "Perm window out of order" - Tried to create a PermMode window while a 
  2503.    normal window is the top window.  Remove or hide window before making a 
  2504.    permanent window.  Routinely, all PermMode windows are created first.
  2505.  
  2506.    "No window to remove" - Tried to remove the initial window Window0 which is 
  2507.    permanent.
  2508.  
  2509.    "Hidden window not found" - Tried to write to a hidden window that does not 
  2510.    exist.  Check for the correct name.
  2511.  
  2512.    "Virtual screen not found" - Tried to write to a virtual screen that does 
  2513.    not exist.  Check for the correct name.
  2514.  
  2515.    "Video page not available" - Tried to write to a video page that has not 
  2516.    been allocated or does not exist for the hardware as expected.  Be sure to 
  2517.    use MaxValidPage.
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.    Appendix B: Error Messages                                          Page 42
  2542.